Chromium Code Reviews| 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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 921 // Allow BrowserPluginHostMsg_* sync messages to run on the UI thread. | 921 // Allow BrowserPluginHostMsg_* sync messages to run on the UI thread. |
| 922 // Platform apps will not support windowed plugins so the deadlock cycle | 922 // Platform apps will not support windowed plugins so the deadlock cycle |
| 923 // browser -> plugin -> renderer -> browser referred in | 923 // browser -> plugin -> renderer -> browser referred in |
| 924 // BrowserMessageFilter::CheckCanDispatchOnUI() is not supposed to happen. If | 924 // BrowserMessageFilter::CheckCanDispatchOnUI() is not supposed to happen. If |
| 925 // we want to support windowed plugins, sync messages in BrowserPlugin might | 925 // we want to support windowed plugins, sync messages in BrowserPlugin might |
| 926 // need to be changed to async messages. | 926 // need to be changed to async messages. |
| 927 // TODO(fsamuel): Disallow BrowserPluginHostMsg_* sync messages to run on UI | 927 // TODO(fsamuel): Disallow BrowserPluginHostMsg_* sync messages to run on UI |
| 928 // thread and make these messages async: http://crbug.com/149063. | 928 // thread and make these messages async: http://crbug.com/149063. |
| 929 if (msg.type() != BrowserPluginHostMsg_HandleInputEvent::ID && | 929 if (msg.type() != BrowserPluginHostMsg_HandleInputEvent::ID && |
| 930 msg.type() != BrowserPluginHostMsg_ResizeGuest::ID && | 930 msg.type() != BrowserPluginHostMsg_ResizeGuest::ID && |
| 931 msg.type() != BrowserPluginHostMsg_SetAutoSize::ID && | |
|
jam
2012/11/09 17:11:10
anyway to avoid this sync IPC?
Fady Samuel
2012/11/09 17:41:10
Yes, but not easily. We have a bug open related to
Fady Samuel
2012/11/09 18:02:53
As per offline discussion, this is a hard, general
| |
| 931 !BrowserMessageFilter::CheckCanDispatchOnUI(msg, this)) | 932 !BrowserMessageFilter::CheckCanDispatchOnUI(msg, this)) |
| 932 return true; | 933 return true; |
| 933 | 934 |
| 934 // Filter out most IPC messages if this renderer is swapped out. | 935 // Filter out most IPC messages if this renderer is swapped out. |
| 935 // We still want to handle certain ACKs to keep our state consistent. | 936 // We still want to handle certain ACKs to keep our state consistent. |
| 936 if (is_swapped_out_) { | 937 if (is_swapped_out_) { |
| 937 if (!SwappedOutMessages::CanHandleWhileSwappedOut(msg)) { | 938 if (!SwappedOutMessages::CanHandleWhileSwappedOut(msg)) { |
| 938 // If this is a synchronous message and we decided not to handle it, | 939 // If this is a synchronous message and we decided not to handle it, |
| 939 // we must send an error reply, or else the renderer will be stuck | 940 // we must send an error reply, or else the renderer will be stuck |
| 940 // and won't respond to future requests. | 941 // and won't respond to future requests. |
| (...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2030 is_waiting_for_beforeunload_ack_ = false; | 2031 is_waiting_for_beforeunload_ack_ = false; |
| 2031 is_waiting_for_unload_ack_ = false; | 2032 is_waiting_for_unload_ack_ = false; |
| 2032 has_timed_out_on_unload_ = false; | 2033 has_timed_out_on_unload_ = false; |
| 2033 } | 2034 } |
| 2034 | 2035 |
| 2035 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 2036 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
| 2036 STLDeleteValues(&power_save_blockers_); | 2037 STLDeleteValues(&power_save_blockers_); |
| 2037 } | 2038 } |
| 2038 | 2039 |
| 2039 } // namespace content | 2040 } // namespace content |
| OLD | NEW |