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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 // The post task to this thread with the process id could be in queue, and we | 762 // The post task to this thread with the process id could be in queue, and we |
763 // don't want to dispatch a message before then since it will need the handle. | 763 // don't want to dispatch a message before then since it will need the handle. |
764 if (child_process_launcher_.get() && child_process_launcher_->IsStarting()) | 764 if (child_process_launcher_.get() && child_process_launcher_->IsStarting()) |
765 return false; | 765 return false; |
766 | 766 |
767 return widget_helper_->WaitForBackingStoreMsg(render_widget_id, | 767 return widget_helper_->WaitForBackingStoreMsg(render_widget_id, |
768 max_delay, msg); | 768 max_delay, msg); |
769 } | 769 } |
770 | 770 |
771 void RenderProcessHostImpl::ReceivedBadMessage() { | 771 void RenderProcessHostImpl::ReceivedBadMessage() { |
| 772 // The embedder can override the decision to kill the child process. |
| 773 if (!GetContentClient()->browser()->ShouldKillChildOnBadMessage()) |
| 774 return; |
| 775 |
772 if (run_renderer_in_process()) { | 776 if (run_renderer_in_process()) { |
773 // In single process mode it is better if we don't suicide but just | 777 // In single process mode it is better if we don't suicide but just |
774 // crash. | 778 // crash. |
775 CHECK(false); | 779 CHECK(false); |
776 } | 780 } |
777 // We kill the renderer but don't include a NOTREACHED, because we want the | 781 // We kill the renderer but don't include a NOTREACHED, because we want the |
778 // browser to try to survive when it gets illegal messages from the renderer. | 782 // browser to try to survive when it gets illegal messages from the renderer. |
779 base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, | 783 base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, |
780 false); | 784 false); |
781 } | 785 } |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1778 // Skip widgets in other processes. | 1782 // Skip widgets in other processes. |
1779 if (widgets[i]->GetProcess()->GetID() != GetID()) | 1783 if (widgets[i]->GetProcess()->GetID() != GetID()) |
1780 continue; | 1784 continue; |
1781 | 1785 |
1782 RenderViewHost* rvh = RenderViewHost::From(widgets[i]); | 1786 RenderViewHost* rvh = RenderViewHost::From(widgets[i]); |
1783 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); | 1787 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); |
1784 } | 1788 } |
1785 } | 1789 } |
1786 | 1790 |
1787 } // namespace content | 1791 } // namespace content |
OLD | NEW |