Index: components/printing/renderer/print_web_view_helper.cc |
diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc |
index 91c72303c93818c2e93668d37be2479ac0c2f506..0a4d1eee41828dff4c84bc857b656243a77e9139 100644 |
--- a/components/printing/renderer/print_web_view_helper.cc |
+++ b/components/printing/renderer/print_web_view_helper.cc |
@@ -1811,19 +1811,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( |
if (buf_size == 0) |
return false; |
-#if defined(OS_WIN) |
- base::SharedMemory shared_buf; |
- // Allocate a shared memory buffer to hold the generated metafile data. |
- if (!shared_buf.CreateAndMapAnonymous(buf_size)) |
- return false; |
- |
- // Copy the bits into shared memory. |
- if (!metafile.GetData(shared_buf.memory(), buf_size)) |
- return false; |
- |
- *shared_mem_handle = base::SharedMemory::DuplicateHandle(shared_buf.handle()); |
- return true; |
-#else |
scoped_ptr<base::SharedMemory> shared_buf( |
content::RenderThread::Get()->HostAllocateSharedMemoryBuffer(buf_size)); |
if (!shared_buf) |
@@ -1835,9 +1822,9 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( |
if (!metafile.GetData(shared_buf->memory(), buf_size)) |
return false; |
- return shared_buf->GiveToProcess(base::GetCurrentProcessHandle(), |
- shared_mem_handle); |
-#endif // defined(OS_WIN) |
+ *shared_mem_handle = |
+ base::SharedMemory::DuplicateHandle(shared_buf->handle()); |
+ return true; |
} |
#if defined(ENABLE_PRINT_PREVIEW) |