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

Unified Diff: content/public/test/mock_render_thread.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: rebase 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 | « content/public/test/mock_render_thread.h ('k') | content/renderer/pepper/pepper_plugin_delegate_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/mock_render_thread.cc
===================================================================
--- content/public/test/mock_render_thread.cc (revision 172434)
+++ content/public/test/mock_render_thread.cc (working copy)
@@ -141,16 +141,16 @@
void MockRenderThread::RecordUserMetrics(const std::string& action) {
}
-base::SharedMemoryHandle MockRenderThread::HostAllocateSharedMemoryBuffer(
- uint32 buffer_size) {
- base::SharedMemory shared_buf;
- if (!shared_buf.CreateAndMapAnonymous(buffer_size)) {
+scoped_ptr<base::SharedMemory>
+ MockRenderThread::HostAllocateSharedMemoryBuffer(
+ uint32 buffer_size) {
+ scoped_ptr<base::SharedMemory> shared_buf(new base::SharedMemory);
+ if (!shared_buf->CreateAndMapAnonymous(buffer_size)) {
NOTREACHED() << "Cannot map shared memory buffer";
- return base::SharedMemory::NULLHandle();
+ return scoped_ptr<base::SharedMemory>();
}
- base::SharedMemoryHandle handle;
- shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), &handle);
- return handle;
+
+ return scoped_ptr<base::SharedMemory>(shared_buf.release());
}
void MockRenderThread::RegisterExtension(v8::Extension* extension) {
« no previous file with comments | « content/public/test/mock_render_thread.h ('k') | content/renderer/pepper/pepper_plugin_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698