| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 if (!ExtensionsBrowserClient::Get()->IsSameContext( | 409 if (!ExtensionsBrowserClient::Get()->IsSameContext( |
| 410 browser_context_, process->GetBrowserContext())) | 410 browser_context_, process->GetBrowserContext())) |
| 411 return; | 411 return; |
| 412 | 412 |
| 413 // If the process is being started asynchronously, early return. We'll end up | 413 // If the process is being started asynchronously, early return. We'll end up |
| 414 // calling InitUserScripts when it's created which will call this again. | 414 // calling InitUserScripts when it's created which will call this again. |
| 415 base::ProcessHandle handle = process->GetHandle(); | 415 base::ProcessHandle handle = process->GetHandle(); |
| 416 if (!handle) | 416 if (!handle) |
| 417 return; | 417 return; |
| 418 | 418 |
| 419 base::SharedMemoryHandle handle_for_process; | 419 base::SharedMemoryHandle handle_for_process = |
| 420 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) | 420 shared_memory->handle().Duplicate(); |
| 421 return; // This can legitimately fail if the renderer asserts at startup. | 421 if (!handle_for_process.IsValid()) |
| 422 return; |
| 422 | 423 |
| 423 if (base::SharedMemory::IsHandleValid(handle_for_process)) { | 424 if (base::SharedMemory::IsHandleValid(handle_for_process)) { |
| 424 process->Send(new ExtensionMsg_UpdateUserScripts( | 425 process->Send(new ExtensionMsg_UpdateUserScripts( |
| 425 handle_for_process, host_id(), changed_hosts, whitelisted_only)); | 426 handle_for_process, host_id(), changed_hosts, whitelisted_only)); |
| 426 } | 427 } |
| 427 } | 428 } |
| 428 | 429 |
| 429 } // namespace extensions | 430 } // namespace extensions |
| OLD | NEW |