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

Unified Diff: extensions/browser/user_script_loader.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
Index: extensions/browser/user_script_loader.cc
diff --git a/extensions/browser/user_script_loader.cc b/extensions/browser/user_script_loader.cc
index 6ebe496964e0d23c73c1481ea3d79ffee966d12d..c20f96a6385963bf57d01a3d9c350646bdd811cb 100644
--- a/extensions/browser/user_script_loader.cc
+++ b/extensions/browser/user_script_loader.cc
@@ -332,9 +332,8 @@ std::unique_ptr<base::SharedMemory> UserScriptLoader::Serialize(
// Copy the pickle to shared memory.
memcpy(shared_memory.memory(), pickle.data(), pickle.size());
- base::SharedMemoryHandle readonly_handle;
- if (!shared_memory.ShareReadOnlyToProcess(base::GetCurrentProcessHandle(),
- &readonly_handle))
+ base::SharedMemoryHandle readonly_handle = shared_memory.GetReadOnlyHandle();
+ if (!readonly_handle.IsValid())
return std::unique_ptr<base::SharedMemory>();
return base::MakeUnique<base::SharedMemory>(readonly_handle,
« no previous file with comments | « content/browser/renderer_host/clipboard_message_filter_unittest.cc ('k') | mojo/edk/embedder/platform_shared_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698