| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 // The post task to this thread with the process id could be in queue, and we | 821 // The post task to this thread with the process id could be in queue, and we |
| 822 // don't want to dispatch a message before then since it will need the handle. | 822 // don't want to dispatch a message before then since it will need the handle. |
| 823 if (child_process_launcher_.get() && child_process_launcher_->IsStarting()) | 823 if (child_process_launcher_.get() && child_process_launcher_->IsStarting()) |
| 824 return false; | 824 return false; |
| 825 | 825 |
| 826 return widget_helper_->WaitForBackingStoreMsg(render_widget_id, | 826 return widget_helper_->WaitForBackingStoreMsg(render_widget_id, |
| 827 max_delay, msg); | 827 max_delay, msg); |
| 828 } | 828 } |
| 829 | 829 |
| 830 void RenderProcessHostImpl::ReceivedBadMessage() { | 830 void RenderProcessHostImpl::ReceivedBadMessage() { |
| 831 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 832 if (command_line->HasSwitch(switches::kDisableKillAfterBadIPC)) |
| 833 return; |
| 834 |
| 831 if (run_renderer_in_process()) { | 835 if (run_renderer_in_process()) { |
| 832 // In single process mode it is better if we don't suicide but just | 836 // In single process mode it is better if we don't suicide but just |
| 833 // crash. | 837 // crash. |
| 834 CHECK(false); | 838 CHECK(false); |
| 835 } | 839 } |
| 836 // We kill the renderer but don't include a NOTREACHED, because we want the | 840 // We kill the renderer but don't include a NOTREACHED, because we want the |
| 837 // browser to try to survive when it gets illegal messages from the renderer. | 841 // browser to try to survive when it gets illegal messages from the renderer. |
| 838 base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, | 842 base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, |
| 839 false); | 843 false); |
| 840 } | 844 } |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1896 // Skip widgets in other processes. | 1900 // Skip widgets in other processes. |
| 1897 if (widget->GetProcess()->GetID() != GetID()) | 1901 if (widget->GetProcess()->GetID() != GetID()) |
| 1898 continue; | 1902 continue; |
| 1899 | 1903 |
| 1900 RenderViewHost* rvh = RenderViewHost::From(widget); | 1904 RenderViewHost* rvh = RenderViewHost::From(widget); |
| 1901 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); | 1905 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); |
| 1902 } | 1906 } |
| 1903 } | 1907 } |
| 1904 | 1908 |
| 1905 } // namespace content | 1909 } // namespace content |
| OLD | NEW |