diff options
Diffstat (limited to 'webkit/glue/plugins/pepper_graphics_3d.cc')
-rw-r--r-- | webkit/glue/plugins/pepper_graphics_3d.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/webkit/glue/plugins/pepper_graphics_3d.cc b/webkit/glue/plugins/pepper_graphics_3d.cc index 3e72c29..2dc4def 100644 --- a/webkit/glue/plugins/pepper_graphics_3d.cc +++ b/webkit/glue/plugins/pepper_graphics_3d.cc @@ -5,7 +5,7 @@ #include "webkit/glue/plugins/pepper_graphics_3d.h" #include "gpu/command_buffer/common/command_buffer.h" -#include "base/lazy_instance.h" +#include "base/singleton.h" #include "base/thread_local.h" #include "ppapi/c/dev/ppb_graphics_3d_dev.h" #include "webkit/glue/plugins/pepper_common.h" @@ -15,8 +15,10 @@ namespace pepper { namespace { -static base::LazyInstance<base::ThreadLocalPointer<Graphics3D> > - g_current_context_key(base::LINKER_INITIALIZED); +struct CurrentContextTag {}; +typedef Singleton<base::ThreadLocalPointer<Graphics3D>, + DefaultSingletonTraits<base::ThreadLocalPointer<Graphics3D> >, + CurrentContextTag> CurrentContextKey; // Size of the transfer buffer. enum { kTransferBufferSize = 512 * 1024 }; @@ -136,11 +138,11 @@ const PPB_Graphics3D_Dev* Graphics3D::GetInterface() { } Graphics3D* Graphics3D::GetCurrent() { - return g_current_context_key.Get().Get(); + return CurrentContextKey::get()->Get(); } void Graphics3D::ResetCurrent() { - g_current_context_key.Get().Set(NULL); + CurrentContextKey::get()->Set(NULL); } Graphics3D::~Graphics3D() { @@ -199,7 +201,7 @@ bool Graphics3D::MakeCurrent() { if (!platform_context_.get()) return false; - g_current_context_key.Get().Set(this); + CurrentContextKey::get()->Set(this); // TODO(apatrick): Return false on context lost. return true; |