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
This commit is contained in:
Aleksei Kuzmin 2017-08-05 02:23:45 +03:00 committed by Cheng Zhao
parent ee9a547985
commit fe952d5c65

View file

@ -1165,8 +1165,9 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
if (!metafile.GetData(shared_buf->memory(), buf_size)) if (!metafile.GetData(shared_buf->memory(), buf_size))
return false; 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) #endif // defined(OS_POSIX)