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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 // The post task to this thread with the process id could be in queue, and we | 742 // The post task to this thread with the process id could be in queue, and we |
743 // don't want to dispatch a message before then since it will need the handle. | 743 // don't want to dispatch a message before then since it will need the handle. |
744 if (child_process_launcher_.get() && child_process_launcher_->IsStarting()) | 744 if (child_process_launcher_.get() && child_process_launcher_->IsStarting()) |
745 return false; | 745 return false; |
746 | 746 |
747 return widget_helper_->WaitForBackingStoreMsg(render_widget_id, | 747 return widget_helper_->WaitForBackingStoreMsg(render_widget_id, |
748 max_delay, msg); | 748 max_delay, msg); |
749 } | 749 } |
750 | 750 |
751 void RenderProcessHostImpl::ReceivedBadMessage() { | 751 void RenderProcessHostImpl::ReceivedBadMessage() { |
| 752 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 753 if (command_line->HasSwitch(switches::kDisableKillAfterBadIPC)) |
| 754 return; |
| 755 |
752 if (run_renderer_in_process()) { | 756 if (run_renderer_in_process()) { |
753 // In single process mode it is better if we don't suicide but just | 757 // In single process mode it is better if we don't suicide but just |
754 // crash. | 758 // crash. |
755 CHECK(false); | 759 CHECK(false); |
756 } | 760 } |
757 // We kill the renderer but don't include a NOTREACHED, because we want the | 761 // We kill the renderer but don't include a NOTREACHED, because we want the |
758 // browser to try to survive when it gets illegal messages from the renderer. | 762 // browser to try to survive when it gets illegal messages from the renderer. |
759 base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, | 763 base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, |
760 false); | 764 false); |
761 } | 765 } |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1767 // Skip widgets in other processes. | 1771 // Skip widgets in other processes. |
1768 if (widgets[i]->GetProcess()->GetID() != GetID()) | 1772 if (widgets[i]->GetProcess()->GetID() != GetID()) |
1769 continue; | 1773 continue; |
1770 | 1774 |
1771 RenderViewHost* rvh = RenderViewHost::From(widgets[i]); | 1775 RenderViewHost* rvh = RenderViewHost::From(widgets[i]); |
1772 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); | 1776 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); |
1773 } | 1777 } |
1774 } | 1778 } |
1775 | 1779 |
1776 } // namespace content | 1780 } // namespace content |
OLD | NEW |