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

Unified Diff: mojo/edk/embedder/platform_shared_buffer.cc

Issue 2845113005: Replace base::SharedMemory read-only methods with GetReadOnlyHandle. (Closed)
Patch Set: Comments from thakis. Created 3 years, 8 months 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 | « extensions/browser/user_script_loader.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/platform_shared_buffer.cc
diff --git a/mojo/edk/embedder/platform_shared_buffer.cc b/mojo/edk/embedder/platform_shared_buffer.cc
index 514cbeb523f9441a34d23cf96f967577e4139d06..a6121503f244ee02bfd1d05538163d6721a43ef6 100644
--- a/mojo/edk/embedder/platform_shared_buffer.cc
+++ b/mojo/edk/embedder/platform_shared_buffer.cc
@@ -204,13 +204,11 @@ PlatformSharedBuffer* PlatformSharedBuffer::CreateReadOnlyDuplicate() {
}
base::SharedMemoryHandle handle;
- bool success;
{
base::AutoLock locker(lock_);
- success = shared_memory_->ShareReadOnlyToProcess(
- base::GetCurrentProcessHandle(), &handle);
+ handle = shared_memory_->GetReadOnlyHandle();
}
- if (!success || !handle.IsValid())
+ if (!handle.IsValid())
return nullptr;
return CreateFromSharedMemoryHandle(num_bytes_, true, handle);
« no previous file with comments | « extensions/browser/user_script_loader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698