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

Unified Diff: ipc/ipc_sync_message_filter.cc

Issue 2068343003: Revert "Send input event IPCs directly from the UI thread" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 | « ipc/ipc_sync_message_filter.h ('k') | ipc/mojo/ipc_channel_mojo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_sync_message_filter.cc
diff --git a/ipc/ipc_sync_message_filter.cc b/ipc/ipc_sync_message_filter.cc
index 5fe03a269d948f0986156b0366f59f42462660ca..08457e2a64b6eec9f038986930ad547102d3fba0 100644
--- a/ipc/ipc_sync_message_filter.cc
+++ b/ipc/ipc_sync_message_filter.cc
@@ -35,7 +35,10 @@ bool SyncMessageFilter::Send(Message* message) {
if (!message->is_sync()) {
{
base::AutoLock auto_lock(lock_);
- if (!io_task_runner_.get()) {
+ if (sender_ && is_channel_send_thread_safe_) {
+ sender_->Send(message);
+ return true;
+ } else if (!io_task_runner_.get()) {
pending_messages_.emplace_back(base::WrapUnique(message));
return true;
}
@@ -153,19 +156,6 @@ bool SyncMessageFilter::OnMessageReceived(const Message& message) {
return false;
}
-bool SyncMessageFilter::SendNow(std::unique_ptr<Message> message) {
- if (!message->is_sync()) {
- base::AutoLock auto_lock(lock_);
- if (sender_ && is_channel_send_thread_safe_) {
- sender_->Send(message.release());
- return true;
- }
- }
-
- // Fall back on default Send behavior.
- return Send(message.release());
-}
-
SyncMessageFilter::SyncMessageFilter(base::WaitableEvent* shutdown_event,
bool is_channel_send_thread_safe)
: sender_(NULL),
« no previous file with comments | « ipc/ipc_sync_message_filter.h ('k') | ipc/mojo/ipc_channel_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698