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

Side by Side Diff: extensions/browser/user_script_loader.cc

Issue 988633003: Refactoring: de-couple Extensions from "script injection System" [render side]:4 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/user_script_loader.h" 5 #include "extensions/browser/user_script_loader.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 // If the process is being started asynchronously, early return. We'll end up 487 // If the process is being started asynchronously, early return. We'll end up
488 // calling InitUserScripts when it's created which will call this again. 488 // calling InitUserScripts when it's created which will call this again.
489 base::ProcessHandle handle = process->GetHandle(); 489 base::ProcessHandle handle = process->GetHandle();
490 if (!handle) 490 if (!handle)
491 return; 491 return;
492 492
493 base::SharedMemoryHandle handle_for_process; 493 base::SharedMemoryHandle handle_for_process;
494 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) 494 if (!shared_memory->ShareToProcess(handle, &handle_for_process))
495 return; // This can legitimately fail if the renderer asserts at startup. 495 return; // This can legitimately fail if the renderer asserts at startup.
496 496
497 // TODO(hanxi): update the IPC message to send a set of HostIDs to render.
498 // Also, remove this function when the refactor is done on render side.
499 std::set<std::string> changed_ids_set;
500 for (const HostID& id : changed_hosts)
501 changed_ids_set.insert(id.id());
502
503 if (base::SharedMemory::IsHandleValid(handle_for_process)) { 497 if (base::SharedMemory::IsHandleValid(handle_for_process)) {
504 process->Send(new ExtensionMsg_UpdateUserScripts( 498 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process,
505 handle_for_process, host_id().id(), changed_ids_set)); 499 host_id(), changed_hosts));
506 } 500 }
507 } 501 }
508 502
509 } // namespace extensions 503 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/common/extension_messages.h » ('j') | extensions/common/extension_messages.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698