| 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 #include "content/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 | 891 |
| 892 bool RenderViewHostImpl::SuddenTerminationAllowed() const { | 892 bool RenderViewHostImpl::SuddenTerminationAllowed() const { |
| 893 return sudden_termination_allowed_ || | 893 return sudden_termination_allowed_ || |
| 894 GetProcess()->SuddenTerminationAllowed(); | 894 GetProcess()->SuddenTerminationAllowed(); |
| 895 } | 895 } |
| 896 | 896 |
| 897 /////////////////////////////////////////////////////////////////////////////// | 897 /////////////////////////////////////////////////////////////////////////////// |
| 898 // RenderViewHostImpl, IPC message handlers: | 898 // RenderViewHostImpl, IPC message handlers: |
| 899 | 899 |
| 900 bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) { | 900 bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) { |
| 901 // Only process messages if the RenderView is alive. |
| 902 if (!renderer_initialized()) |
| 903 return false; |
| 904 |
| 901 if (!BrowserMessageFilter::CheckCanDispatchOnUI( | 905 if (!BrowserMessageFilter::CheckCanDispatchOnUI( |
| 902 msg, static_cast<RenderWidgetHostImpl*>(this))) { | 906 msg, static_cast<RenderWidgetHostImpl*>(this))) { |
| 903 return true; | 907 return true; |
| 904 } | 908 } |
| 905 | 909 |
| 906 // Filter out most IPC messages if this renderer is swapped out. | 910 // Filter out most IPC messages if this renderer is swapped out. |
| 907 // We still want to handle certain ACKs to keep our state consistent. | 911 // We still want to handle certain ACKs to keep our state consistent. |
| 908 if (is_swapped_out_) { | 912 if (is_swapped_out_) { |
| 909 if (!SwappedOutMessages::CanHandleWhileSwappedOut(msg)) { | 913 if (!SwappedOutMessages::CanHandleWhileSwappedOut(msg)) { |
| 910 // If this is a synchronous message and we decided not to handle it, | 914 // If this is a synchronous message and we decided not to handle it, |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1403 } else { | 1407 } else { |
| 1404 render_view_ready_on_process_launch_ = true; | 1408 render_view_ready_on_process_launch_ = true; |
| 1405 } | 1409 } |
| 1406 } | 1410 } |
| 1407 | 1411 |
| 1408 void RenderViewHostImpl::RenderViewReady() { | 1412 void RenderViewHostImpl::RenderViewReady() { |
| 1409 delegate_->RenderViewReady(this); | 1413 delegate_->RenderViewReady(this); |
| 1410 } | 1414 } |
| 1411 | 1415 |
| 1412 } // namespace content | 1416 } // namespace content |
| OLD | NEW |