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

Unified Diff: ipc/ipc_sync_channel.cc

Issue 1279863004: Complete SyncMessageFilter initialization after SyncChannel initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eh, vector instead of list Created 5 years, 4 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_channel.h ('k') | ipc/ipc_sync_message_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_sync_channel.cc
diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc
index 845eccd813d2f408d8da76ce4aeddd5ce5e2a56b..04ebd4177ef857c466c8fb85c994f6a1facc2c5a 100644
--- a/ipc/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -465,6 +465,8 @@ scoped_refptr<SyncMessageFilter> SyncChannel::CreateSyncMessageFilter() {
sync_context()->shutdown_event(),
sync_context()->IsChannelSendThreadSafe());
AddFilter(filter.get());
+ if (!did_init())
+ pre_init_sync_message_filters_.push_back(filter);
return filter;
}
@@ -592,4 +594,12 @@ void SyncChannel::StartWatching() {
dispatch_watcher_callback_);
}
+void SyncChannel::OnChannelInit() {
+ for (const auto& filter : pre_init_sync_message_filters_) {
+ filter->set_is_channel_send_thread_safe(
+ context()->IsChannelSendThreadSafe());
+ }
+ pre_init_sync_message_filters_.clear();
+}
+
} // namespace IPC
« no previous file with comments | « ipc/ipc_sync_channel.h ('k') | ipc/ipc_sync_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698