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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 11469015: Renderer process can allocate anonymous shared memory without help from browser process on Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years 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/render_thread_impl.cc
===================================================================
--- content/renderer/render_thread_impl.cc (revision 171370)
+++ content/renderer/render_thread_impl.cc (working copy)
@@ -894,6 +894,13 @@
scoped_ptr<base::SharedMemory> RenderThreadImpl::AllocateSharedMemory(
uint32 size) {
+#if defined(OS_WIN)
+ scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory);
+ if (!shared_memory->CreateAnonymous(size))
jamesr 2012/12/06 22:31:12 content/renderer/pepper/pepper_plugin_delegate_imp
+ return scoped_ptr<base::SharedMemory>();
+
+ return scoped_ptr<base::SharedMemory>(shared_memory.release());
+#else
base::SharedMemoryHandle handle;
bool success;
IPC::Message* message =
@@ -911,6 +918,7 @@
if (!base::SharedMemory::IsHandleValid(handle))
return scoped_ptr<base::SharedMemory>();
return scoped_ptr<base::SharedMemory>(new base::SharedMemory(handle, false));
+#endif // defined(OS_WIN)
}
int32 RenderThreadImpl::CreateViewCommandBuffer(
« 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