| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |