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

Unified Diff: content/public/browser/browser_message_filter.cc

Issue 1723473003: Remove limitation that renderer can't send sync IPCs to the UI thread in the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/browser/browser_message_filter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/browser_message_filter.cc
diff --git a/content/public/browser/browser_message_filter.cc b/content/public/browser/browser_message_filter.cc
index b2482cd408a27f292cf25f4303ec5b7f0d003486..76a0e0499ca9ab5cf023d4d902683c22b83f73ac 100644
--- a/content/public/browser/browser_message_filter.cc
+++ b/content/public/browser/browser_message_filter.cc
@@ -69,11 +69,6 @@ class BrowserMessageFilter::Internal : public IPC::MessageFilter {
return DispatchMessage(message);
}
- if (thread == BrowserThread::UI &&
- !BrowserMessageFilter::CheckCanDispatchOnUI(message, filter_.get())) {
- return true;
- }
-
BrowserThread::PostTask(
thread, FROM_HERE,
base::Bind(
@@ -157,31 +152,6 @@ base::TaskRunner* BrowserMessageFilter::OverrideTaskRunnerForMessage(
return nullptr;
}
-bool BrowserMessageFilter::CheckCanDispatchOnUI(const IPC::Message& message,
- IPC::Sender* sender) {
-#if defined(OS_WIN)
- // On Windows there's a potential deadlock with sync messsages going in
- // a circle from browser -> plugin -> renderer -> browser.
- // On Linux we can avoid this by avoiding sync messages from browser->plugin.
- // On Mac we avoid this by not supporting windowed plugins.
- if (message.is_sync() && !message.is_caller_pumping_messages()) {
- // NOTE: IF YOU HIT THIS ASSERT, THE SOLUTION IS ALMOST NEVER TO RUN A
- // NESTED MESSAGE LOOP IN THE RENDERER!!!
- // That introduces reentrancy which causes hard to track bugs. You should
- // find a way to either turn this into an asynchronous message, or one
- // that can be answered on the IO thread.
- NOTREACHED() << "Can't send sync messages to UI thread without pumping "
- "messages in the renderer or else deadlocks can occur if the page "
- "has windowed plugins! (message type " << message.type() << ")";
- IPC::Message* reply = IPC::SyncMessage::GenerateReply(&message);
- reply->set_reply_error();
- sender->Send(reply);
- return false;
- }
-#endif
- return true;
-}
-
void BrowserMessageFilter::ShutdownForBadMessage() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kDisableKillAfterBadIPC))
« no previous file with comments | « content/public/browser/browser_message_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698