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

Unified Diff: content/renderer/pepper_plugin_delegate_impl.cc

Issue 7065046: PPAPI: Do not try to allocation shared memory directly from a renderer. Always ask the browser. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper_plugin_delegate_impl.cc
===================================================================
--- content/renderer/pepper_plugin_delegate_impl.cc (revision 86296)
+++ content/renderer/pepper_plugin_delegate_impl.cc (working copy)
@@ -1301,11 +1301,6 @@
uint32_t size) {
if (size == 0)
return NULL;
- scoped_ptr<base::SharedMemory> shm(new base::SharedMemory());
- if (shm->CreateAnonymous(size))
- return shm.release();
- // The sandbox can prevent CreateAnonymous from succeeding, in which case we
- // need to IPC to the browser process.
base::SharedMemoryHandle handle;
if (!render_view_->Send(
new ViewHostMsg_AllocateSharedMemoryBuffer(size, &handle))) {
@@ -1316,6 +1311,5 @@
DLOG(WARNING) << "Browser failed to allocate shared memory";
return NULL;
}
- shm.reset(new base::SharedMemory(handle, false));
- return shm.release();
+ return new base::SharedMemory(handle, false);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698