Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 10868012: Browser Plugin: New Implementation (Browser Side) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master-trial-obrowser
Patch Set: integrate windows fix by Fady (original cl #10910228) Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
32 #include "content/common/content_constants_internal.h" 33 #include "content/common/content_constants_internal.h"
33 #include "content/common/desktop_notification_messages.h" 34 #include "content/common/desktop_notification_messages.h"
34 #include "content/common/drag_messages.h" 35 #include "content/common/drag_messages.h"
35 #include "content/common/inter_process_time_ticks_converter.h" 36 #include "content/common/inter_process_time_ticks_converter.h"
36 #include "content/common/speech_recognition_messages.h" 37 #include "content/common/speech_recognition_messages.h"
37 #include "content/common/swapped_out_messages.h" 38 #include "content/common/swapped_out_messages.h"
38 #include "content/common/view_messages.h" 39 #include "content/common/view_messages.h"
39 #include "content/port/browser/render_view_host_delegate_view.h" 40 #include "content/port/browser/render_view_host_delegate_view.h"
40 #include "content/port/browser/render_widget_host_view_port.h" 41 #include "content/port/browser/render_widget_host_view_port.h"
41 #include "content/public/browser/browser_accessibility_state.h" 42 #include "content/public/browser/browser_accessibility_state.h"
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 821
821 bool RenderViewHostImpl::SuddenTerminationAllowed() const { 822 bool RenderViewHostImpl::SuddenTerminationAllowed() const {
822 return sudden_termination_allowed_ || 823 return sudden_termination_allowed_ ||
823 GetProcess()->SuddenTerminationAllowed(); 824 GetProcess()->SuddenTerminationAllowed();
824 } 825 }
825 826
826 /////////////////////////////////////////////////////////////////////////////// 827 ///////////////////////////////////////////////////////////////////////////////
827 // RenderViewHostImpl, IPC message handlers: 828 // RenderViewHostImpl, IPC message handlers:
828 829
829 bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) { 830 bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) {
830 if (!BrowserMessageFilter::CheckCanDispatchOnUI(msg, this)) 831 // Allow BrowserPluginHostMsg_* sync messages to run on the UI thread.
Charlie Reis 2012/09/13 00:51:44 This doesn't sound safe. Why is it ok to process
Fady Samuel 2012/09/13 14:17:18 I've copied-and-pasted BrowserMessageFilter::Check
Charlie Reis 2012/09/13 16:55:30 Ok. Let's put that justification in the comment a
lazyboy 2012/09/13 18:52:49 Done.
832 if (msg.type() != BrowserPluginHostMsg_HandleInputEvent::ID &&
833 msg.type() != BrowserPluginHostMsg_ResizeGuest::ID &&
834 !BrowserMessageFilter::CheckCanDispatchOnUI(msg, this))
831 return true; 835 return true;
832 836
833 // Filter out most IPC messages if this renderer is swapped out. 837 // Filter out most IPC messages if this renderer is swapped out.
834 // We still want to handle certain ACKs to keep our state consistent. 838 // We still want to handle certain ACKs to keep our state consistent.
835 if (is_swapped_out_) { 839 if (is_swapped_out_) {
836 if (!content::SwappedOutMessages::CanHandleWhileSwappedOut(msg)) { 840 if (!content::SwappedOutMessages::CanHandleWhileSwappedOut(msg)) {
837 // If this is a synchronous message and we decided not to handle it, 841 // If this is a synchronous message and we decided not to handle it,
838 // we must send an error reply, or else the renderer will be stuck 842 // we must send an error reply, or else the renderer will be stuck
839 // and won't respond to future requests. 843 // and won't respond to future requests.
840 if (msg.is_sync()) { 844 if (msg.is_sync()) {
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1921 // can cause navigations to be ignored in OnMsgNavigate. 1925 // can cause navigations to be ignored in OnMsgNavigate.
1922 is_waiting_for_beforeunload_ack_ = false; 1926 is_waiting_for_beforeunload_ack_ = false;
1923 is_waiting_for_unload_ack_ = false; 1927 is_waiting_for_unload_ack_ = false;
1924 } 1928 }
1925 1929
1926 void RenderViewHostImpl::ClearPowerSaveBlockers() { 1930 void RenderViewHostImpl::ClearPowerSaveBlockers() {
1927 STLDeleteValues(&power_save_blockers_); 1931 STLDeleteValues(&power_save_blockers_);
1928 } 1932 }
1929 1933
1930 } // namespace content 1934 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698