From fe952d5c653dc6c05e04d8fb6bdd87746ef7550e Mon Sep 17 00:00:00 2001 From: Aleksei Kuzmin Date: Sat, 5 Aug 2017 02:23:45 +0300 Subject: [PATCH] Get rid of SharedMemory::GiveToProcess. https://codereview.chromium.org/2847033003 Changes copied from "printing: Sandboxed processes must ask the browser to allocate shared memory." https://codereview.chromium.org/1714643002 --- .../chrome/renderer/printing/print_web_view_helper.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper.cc b/chromium_src/chrome/renderer/printing/print_web_view_helper.cc index f8d490ba3bf..66ec64e523c 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper.cc +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper.cc @@ -1165,8 +1165,9 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( if (!metafile.GetData(shared_buf->memory(), buf_size)) return false; - return shared_buf->GiveToProcess(base::GetCurrentProcessHandle(), - shared_mem_handle); + *shared_mem_handle = + base::SharedMemory::DuplicateHandle(shared_buf->handle()); + return true; } #endif // defined(OS_POSIX)