| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 void BrowserRenderProcessHost::InitExtensions() { | 586 void BrowserRenderProcessHost::InitExtensions() { |
| 587 // TODO(aa): Should only bother sending these function names if this is an | 587 // TODO(aa): Should only bother sending these function names if this is an |
| 588 // extension process. | 588 // extension process. |
| 589 std::vector<std::string> function_names; | 589 std::vector<std::string> function_names; |
| 590 ExtensionFunctionDispatcher::GetAllFunctionNames(&function_names); | 590 ExtensionFunctionDispatcher::GetAllFunctionNames(&function_names); |
| 591 Send(new ViewMsg_Extension_SetFunctionNames(function_names)); | 591 Send(new ViewMsg_Extension_SetFunctionNames(function_names)); |
| 592 } | 592 } |
| 593 | 593 |
| 594 void BrowserRenderProcessHost::SendUserScriptsUpdate( | 594 void BrowserRenderProcessHost::SendUserScriptsUpdate( |
| 595 base::SharedMemory *shared_memory) { | 595 base::SharedMemory *shared_memory) { |
| 596 // Don't send user scripts to extension processes. We currently don't allow |
| 597 // user scripts to run in extensions, so it would be pointless. It would also |
| 598 // mess up the crash reporting, which sends a different set of "active" |
| 599 // extensions depending on whether the process is an extension or renderer |
| 600 // process. |
| 601 if (extension_process_) |
| 602 return; |
| 603 |
| 596 // Process is being started asynchronously. We'll end up calling | 604 // Process is being started asynchronously. We'll end up calling |
| 597 // InitUserScripts when it's created which will call this again. | 605 // InitUserScripts when it's created which will call this again. |
| 598 if (child_process_.get() && child_process_->IsStarting()) | 606 if (child_process_.get() && child_process_->IsStarting()) |
| 599 return; | 607 return; |
| 600 | 608 |
| 601 base::SharedMemoryHandle handle_for_process; | 609 base::SharedMemoryHandle handle_for_process; |
| 602 if (!shared_memory->ShareToProcess(GetHandle(), &handle_for_process)) { | 610 if (!shared_memory->ShareToProcess(GetHandle(), &handle_for_process)) { |
| 603 // This can legitimately fail if the renderer asserts at startup. | 611 // This can legitimately fail if the renderer asserts at startup. |
| 604 return; | 612 return; |
| 605 } | 613 } |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 IPC::PlatformFileForTransit(), | 996 IPC::PlatformFileForTransit(), |
| 989 std::vector<std::string>(), | 997 std::vector<std::string>(), |
| 990 std::string(), | 998 std::string(), |
| 991 false)); | 999 false)); |
| 992 } | 1000 } |
| 993 } | 1001 } |
| 994 | 1002 |
| 995 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { | 1003 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { |
| 996 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); | 1004 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); |
| 997 } | 1005 } |
| OLD | NEW |