| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 // renderer | 751 // renderer |
| 752 const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); | 752 const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); |
| 753 if (cmd_line.HasSwitch(switches::kRendererCmdPrefix)) | 753 if (cmd_line.HasSwitch(switches::kRendererCmdPrefix)) |
| 754 return; | 754 return; |
| 755 CHECK(peer_pid == process_.pid()); | 755 CHECK(peer_pid == process_.pid()); |
| 756 } | 756 } |
| 757 } | 757 } |
| 758 } | 758 } |
| 759 | 759 |
| 760 // Static. This function can be called from the IO Thread or from the UI thread. | 760 // Static. This function can be called from the IO Thread or from the UI thread. |
| 761 void BrowserRenderProcessHost::BadMessageTerminateProcess(uint16 msg_type, | 761 void BrowserRenderProcessHost::BadMessageTerminateProcess( |
| 762 base::ProcessHandle pr
ocess) { | 762 uint16 msg_type, |
| 763 base::ProcessHandle process) { |
| 763 LOG(ERROR) << "bad message " << msg_type << " terminating renderer."; | 764 LOG(ERROR) << "bad message " << msg_type << " terminating renderer."; |
| 764 if (BrowserRenderProcessHost::run_renderer_in_process()) { | 765 if (BrowserRenderProcessHost::run_renderer_in_process()) { |
| 765 // In single process mode it is better if we don't suicide but just crash. | 766 // In single process mode it is better if we don't suicide but just crash. |
| 766 CHECK(false); | 767 CHECK(false); |
| 767 } | 768 } |
| 768 NOTREACHED(); | 769 NOTREACHED(); |
| 769 base::KillProcess(process, ResultCodes::KILLED_BAD_MESSAGE, false); | 770 base::KillProcess(process, ResultCodes::KILLED_BAD_MESSAGE, false); |
| 770 } | 771 } |
| 771 | 772 |
| 772 void BrowserRenderProcessHost::OnChannelError() { | 773 void BrowserRenderProcessHost::OnChannelError() { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 SendUserScriptsUpdate(shared_memory); | 904 SendUserScriptsUpdate(shared_memory); |
| 904 } | 905 } |
| 905 break; | 906 break; |
| 906 } | 907 } |
| 907 default: { | 908 default: { |
| 908 NOTREACHED(); | 909 NOTREACHED(); |
| 909 break; | 910 break; |
| 910 } | 911 } |
| 911 } | 912 } |
| 912 } | 913 } |
| OLD | NEW |