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 |