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