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

Unified Diff: extensions/browser/user_script_loader.cc

Issue 2852803002: Remove base::SharedMemory::ShareToProcess. (Closed)
Patch Set: Rebase. 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 c20f96a6385963bf57d01a3d9c350646bdd811cb..3eaa3ffc37577f26ef9263a0108e056d2e9d6f13 100644
--- a/extensions/browser/user_script_loader.cc
+++ b/extensions/browser/user_script_loader.cc
@@ -416,9 +416,10 @@ void UserScriptLoader::SendUpdate(content::RenderProcessHost* process,
if (!handle)
return;
- base::SharedMemoryHandle handle_for_process;
- if (!shared_memory->ShareToProcess(handle, &handle_for_process))
- return; // This can legitimately fail if the renderer asserts at startup.
+ base::SharedMemoryHandle handle_for_process =
+ shared_memory->handle().Duplicate();
+ if (!handle_for_process.IsValid())
+ return;
if (base::SharedMemory::IsHandleValid(handle_for_process)) {
Nico 2017/05/02 20:08:00 Is this just an alias for handle_for_process.isVal
erikchen 2017/05/02 21:33:10 Yes. We could do a whole other refactor to make th
process->Send(new ExtensionMsg_UpdateUserScripts(

Powered by Google App Engine
This is Rietveld 408576698