| 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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 | 870 |
| 871 bool RenderViewHostImpl::SuddenTerminationAllowed() const { | 871 bool RenderViewHostImpl::SuddenTerminationAllowed() const { |
| 872 return sudden_termination_allowed_ || | 872 return sudden_termination_allowed_ || |
| 873 GetProcess()->SuddenTerminationAllowed(); | 873 GetProcess()->SuddenTerminationAllowed(); |
| 874 } | 874 } |
| 875 | 875 |
| 876 /////////////////////////////////////////////////////////////////////////////// | 876 /////////////////////////////////////////////////////////////////////////////// |
| 877 // RenderViewHostImpl, IPC message handlers: | 877 // RenderViewHostImpl, IPC message handlers: |
| 878 | 878 |
| 879 bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) { | 879 bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) { |
| 880 if (!BrowserMessageFilter::CheckCanDispatchOnUI(msg, GetWidget())) | |
| 881 return true; | |
| 882 | |
| 883 // Filter out most IPC messages if this renderer is swapped out. | 880 // Filter out most IPC messages if this renderer is swapped out. |
| 884 // We still want to handle certain ACKs to keep our state consistent. | 881 // We still want to handle certain ACKs to keep our state consistent. |
| 885 if (is_swapped_out_) { | 882 if (is_swapped_out_) { |
| 886 if (!SwappedOutMessages::CanHandleWhileSwappedOut(msg)) { | 883 if (!SwappedOutMessages::CanHandleWhileSwappedOut(msg)) { |
| 887 // If this is a synchronous message and we decided not to handle it, | 884 // If this is a synchronous message and we decided not to handle it, |
| 888 // we must send an error reply, or else the renderer will be stuck | 885 // we must send an error reply, or else the renderer will be stuck |
| 889 // and won't respond to future requests. | 886 // and won't respond to future requests. |
| 890 if (msg.is_sync()) { | 887 if (msg.is_sync()) { |
| 891 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&msg); | 888 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&msg); |
| 892 reply->set_reply_error(); | 889 reply->set_reply_error(); |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 } else { | 1358 } else { |
| 1362 render_view_ready_on_process_launch_ = true; | 1359 render_view_ready_on_process_launch_ = true; |
| 1363 } | 1360 } |
| 1364 } | 1361 } |
| 1365 | 1362 |
| 1366 void RenderViewHostImpl::RenderViewReady() { | 1363 void RenderViewHostImpl::RenderViewReady() { |
| 1367 delegate_->RenderViewReady(this); | 1364 delegate_->RenderViewReady(this); |
| 1368 } | 1365 } |
| 1369 | 1366 |
| 1370 } // namespace content | 1367 } // namespace content |
| OLD | NEW |