Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(836)

Unified Diff: content/renderer/pepper/ppb_graphics_3d_impl.cc

Issue 547733002: [Pepper GL] Use shared state to fix a memory leak in MapSub GL extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remve base/memory/shared_memory.h from DEPS Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/pepper/ppb_graphics_3d_impl.h ('k') | content/renderer/pepper/resource_creation_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/ppb_graphics_3d_impl.cc
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc
index a4ff059b9c527b7a6ea22bd8017f0a0022daadb3..7486abce9ff90024dcc8938491f6c0ac378506e2 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.cc
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc
@@ -81,9 +81,11 @@ PP_Resource PPB_Graphics3D_Impl::Create(PP_Instance instance,
}
// static
-PP_Resource PPB_Graphics3D_Impl::CreateRaw(PP_Instance instance,
- PP_Resource share_context,
- const int32_t* attrib_list) {
+PP_Resource PPB_Graphics3D_Impl::CreateRaw(
+ PP_Instance instance,
+ PP_Resource share_context,
+ const int32_t* attrib_list,
+ base::SharedMemoryHandle* shared_state_handle) {
PPB_Graphics3D_API* share_api = NULL;
if (share_context) {
EnterResourceNoLock<PPB_Graphics3D_API> enter(share_context, true);
@@ -93,7 +95,7 @@ PP_Resource PPB_Graphics3D_Impl::CreateRaw(PP_Instance instance,
}
scoped_refptr<PPB_Graphics3D_Impl> graphics_3d(
new PPB_Graphics3D_Impl(instance));
- if (!graphics_3d->InitRaw(share_api, attrib_list))
+ if (!graphics_3d->InitRaw(share_api, attrib_list, shared_state_handle))
return 0;
return graphics_3d->GetReference();
}
@@ -207,7 +209,7 @@ int32 PPB_Graphics3D_Impl::DoSwapBuffers() {
bool PPB_Graphics3D_Impl::Init(PPB_Graphics3D_API* share_context,
const int32_t* attrib_list) {
- if (!InitRaw(share_context, attrib_list))
+ if (!InitRaw(share_context, attrib_list, NULL))
return false;
gpu::gles2::GLES2Implementation* share_gles2 = NULL;
@@ -219,8 +221,10 @@ bool PPB_Graphics3D_Impl::Init(PPB_Graphics3D_API* share_context,
return CreateGLES2Impl(kCommandBufferSize, kTransferBufferSize, share_gles2);
}
-bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
- const int32_t* attrib_list) {
+bool PPB_Graphics3D_Impl::InitRaw(
+ PPB_Graphics3D_API* share_context,
+ const int32_t* attrib_list,
+ base::SharedMemoryHandle* shared_state_handle) {
PepperPluginInstanceImpl* plugin_instance =
HostGlobals::Get()->GetInstance(pp_instance());
if (!plugin_instance)
@@ -289,6 +293,8 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
return false;
if (!command_buffer_->Initialize())
return false;
+ if (shared_state_handle)
+ *shared_state_handle = command_buffer_->GetSharedStateHandle();
mailbox_ = gpu::Mailbox::Generate();
if (!command_buffer_->ProduceFrontBuffer(mailbox_))
return false;
« no previous file with comments | « content/renderer/pepper/ppb_graphics_3d_impl.h ('k') | content/renderer/pepper/resource_creation_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698