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

Side by Side Diff: content/browser/browser_message_filter.cc

Issue 8566011: Completes the GetWindowRect/GetRootWindowRect/GetScreenInfo changes I thought I had finished with... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_message_filter.h" 5 #include "content/browser/browser_message_filter.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/process.h" 8 #include "base/process.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "content/browser/user_metrics.h" 10 #include "content/browser/user_metrics.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return rv; 93 return rv;
94 } 94 }
95 95
96 void BrowserMessageFilter::BadMessageReceived() { 96 void BrowserMessageFilter::BadMessageReceived() {
97 base::KillProcess(peer_handle(), content::RESULT_CODE_KILLED_BAD_MESSAGE, 97 base::KillProcess(peer_handle(), content::RESULT_CODE_KILLED_BAD_MESSAGE,
98 false); 98 false);
99 } 99 }
100 100
101 bool BrowserMessageFilter::CheckCanDispatchOnUI(const IPC::Message& message, 101 bool BrowserMessageFilter::CheckCanDispatchOnUI(const IPC::Message& message,
102 IPC::Message::Sender* sender) { 102 IPC::Message::Sender* sender) {
103 #if defined(OS_WIN) 103 #if defined(OS_WIN) && !defined(USE_AURA)
104 // On Windows there's a potential deadlock with sync messsages going in 104 // On Windows there's a potential deadlock with sync messsages going in
105 // a circle from browser -> plugin -> renderer -> browser. 105 // a circle from browser -> plugin -> renderer -> browser.
106 // On Linux we can avoid this by avoiding sync messages from browser->plugin. 106 // On Linux we can avoid this by avoiding sync messages from browser->plugin.
107 // On Mac we avoid this by not supporting windowed plugins. 107 // On Mac we avoid this by not supporting windowed plugins.
108 if (message.is_sync() && !message.is_caller_pumping_messages()) { 108 if (message.is_sync() && !message.is_caller_pumping_messages()) {
109 // NOTE: IF YOU HIT THIS ASSERT, THE SOLUTION IS ALMOST NEVER TO RUN A 109 // NOTE: IF YOU HIT THIS ASSERT, THE SOLUTION IS ALMOST NEVER TO RUN A
110 // NESTED MESSAGE LOOP IN THE RENDERER!!! 110 // NESTED MESSAGE LOOP IN THE RENDERER!!!
111 // That introduces reentrancy which causes hard to track bugs. You should 111 // That introduces reentrancy which causes hard to track bugs. You should
112 // find a way to either turn this into an asynchronous message, or one 112 // find a way to either turn this into an asynchronous message, or one
113 // that can be answered on the IO thread. 113 // that can be answered on the IO thread.
114 NOTREACHED() << "Can't send sync messages to UI thread without pumping " 114 NOTREACHED() << "Can't send sync messages to UI thread without pumping "
115 "messages in the renderer or else deadlocks can occur if the page " 115 "messages in the renderer or else deadlocks can occur if the page "
116 "has windowed plugins! (message type " << message.type() << ")"; 116 "has windowed plugins! (message type " << message.type() << ")";
117 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&message); 117 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&message);
118 reply->set_reply_error(); 118 reply->set_reply_error();
119 sender->Send(reply); 119 sender->Send(reply);
120 return false; 120 return false;
121 } 121 }
122 #endif 122 #endif
123 return true; 123 return true;
124 } 124 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_views_win.cc ('k') | content/browser/renderer_host/render_widget_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698