| 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 11 matching lines...) Expand all Loading... |
| 22 #include "content/browser/child_process_security_policy_impl.h" | 22 #include "content/browser/child_process_security_policy_impl.h" |
| 23 #include "content/browser/cross_site_request_manager.h" | 23 #include "content/browser/cross_site_request_manager.h" |
| 24 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 24 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 25 #include "content/browser/gpu/gpu_surface_tracker.h" | 25 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 26 #include "content/browser/host_zoom_map_impl.h" | 26 #include "content/browser/host_zoom_map_impl.h" |
| 27 #include "content/browser/power_save_blocker.h" | 27 #include "content/browser/power_save_blocker.h" |
| 28 #include "content/browser/renderer_host/dip_util.h" | 28 #include "content/browser/renderer_host/dip_util.h" |
| 29 #include "content/browser/renderer_host/render_process_host_impl.h" | 29 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 30 #include "content/browser/renderer_host/render_view_host_delegate.h" | 30 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 31 #include "content/common/accessibility_messages.h" | 31 #include "content/common/accessibility_messages.h" |
| 32 #include "content/common/browser_plugin_messages.h" | |
| 33 #include "content/common/content_constants_internal.h" | 32 #include "content/common/content_constants_internal.h" |
| 34 #include "content/common/desktop_notification_messages.h" | 33 #include "content/common/desktop_notification_messages.h" |
| 35 #include "content/common/drag_messages.h" | 34 #include "content/common/drag_messages.h" |
| 36 #include "content/common/inter_process_time_ticks_converter.h" | 35 #include "content/common/inter_process_time_ticks_converter.h" |
| 37 #include "content/common/speech_recognition_messages.h" | 36 #include "content/common/speech_recognition_messages.h" |
| 38 #include "content/common/swapped_out_messages.h" | 37 #include "content/common/swapped_out_messages.h" |
| 39 #include "content/common/view_messages.h" | 38 #include "content/common/view_messages.h" |
| 40 #include "content/port/browser/render_view_host_delegate_view.h" | 39 #include "content/port/browser/render_view_host_delegate_view.h" |
| 41 #include "content/port/browser/render_widget_host_view_port.h" | 40 #include "content/port/browser/render_widget_host_view_port.h" |
| 42 #include "content/public/browser/browser_accessibility_state.h" | 41 #include "content/public/browser/browser_accessibility_state.h" |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 | 826 |
| 828 bool RenderViewHostImpl::SuddenTerminationAllowed() const { | 827 bool RenderViewHostImpl::SuddenTerminationAllowed() const { |
| 829 return sudden_termination_allowed_ || | 828 return sudden_termination_allowed_ || |
| 830 GetProcess()->SuddenTerminationAllowed(); | 829 GetProcess()->SuddenTerminationAllowed(); |
| 831 } | 830 } |
| 832 | 831 |
| 833 /////////////////////////////////////////////////////////////////////////////// | 832 /////////////////////////////////////////////////////////////////////////////// |
| 834 // RenderViewHostImpl, IPC message handlers: | 833 // RenderViewHostImpl, IPC message handlers: |
| 835 | 834 |
| 836 bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) { | 835 bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) { |
| 837 // Allow BrowserPluginHostMsg_* sync messages to run on the UI thread. | 836 if (!BrowserMessageFilter::CheckCanDispatchOnUI(msg, this)) |
| 838 // Platform apps will not support windowed plugins so the deadlock cycle | |
| 839 // browser -> plugin -> renderer -> browser referred in | |
| 840 // BrowserMessageFilter::CheckCanDispatchOnUI() is not supposed to happen. If | |
| 841 // we want to support windowed plugins, sync messages in BrowserPlugin might | |
| 842 // need to be changed to async messages. | |
| 843 // TODO(fsamuel): Disallow BrowserPluginHostMsg_* sync messages to run on UI | |
| 844 // thread and make these messages async: http://crbug.com/149063. | |
| 845 if (msg.type() != BrowserPluginHostMsg_HandleInputEvent::ID && | |
| 846 msg.type() != BrowserPluginHostMsg_ResizeGuest::ID && | |
| 847 !BrowserMessageFilter::CheckCanDispatchOnUI(msg, this)) | |
| 848 return true; | 837 return true; |
| 849 | 838 |
| 850 // Filter out most IPC messages if this renderer is swapped out. | 839 // Filter out most IPC messages if this renderer is swapped out. |
| 851 // We still want to handle certain ACKs to keep our state consistent. | 840 // We still want to handle certain ACKs to keep our state consistent. |
| 852 if (is_swapped_out_) { | 841 if (is_swapped_out_) { |
| 853 if (!content::SwappedOutMessages::CanHandleWhileSwappedOut(msg)) { | 842 if (!content::SwappedOutMessages::CanHandleWhileSwappedOut(msg)) { |
| 854 // If this is a synchronous message and we decided not to handle it, | 843 // If this is a synchronous message and we decided not to handle it, |
| 855 // we must send an error reply, or else the renderer will be stuck | 844 // we must send an error reply, or else the renderer will be stuck |
| 856 // and won't respond to future requests. | 845 // and won't respond to future requests. |
| 857 if (msg.is_sync()) { | 846 if (msg.is_sync()) { |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1938 // can cause navigations to be ignored in OnMsgNavigate. | 1927 // can cause navigations to be ignored in OnMsgNavigate. |
| 1939 is_waiting_for_beforeunload_ack_ = false; | 1928 is_waiting_for_beforeunload_ack_ = false; |
| 1940 is_waiting_for_unload_ack_ = false; | 1929 is_waiting_for_unload_ack_ = false; |
| 1941 } | 1930 } |
| 1942 | 1931 |
| 1943 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1932 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
| 1944 STLDeleteValues(&power_save_blockers_); | 1933 STLDeleteValues(&power_save_blockers_); |
| 1945 } | 1934 } |
| 1946 | 1935 |
| 1947 } // namespace content | 1936 } // namespace content |
| OLD | NEW |