summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_sync_channel.cc
diff options
context:
space:
mode:
authorrockot <rockot@chromium.org>2015-08-05 17:32:29 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-06 00:32:58 +0000
commitac64ae92ff624f1befe3b973e0f0fd0204f2eac1 (patch)
tree5bea405e1851c88caac237c9edbcc6edf3361ac0 /ipc/ipc_sync_channel.cc
parentf4acab417af4a182dbbb6bbc5aa1235662a9253c (diff)
downloadchromium_src-ac64ae92ff624f1befe3b973e0f0fd0204f2eac1.zip
chromium_src-ac64ae92ff624f1befe3b973e0f0fd0204f2eac1.tar.gz
chromium_src-ac64ae92ff624f1befe3b973e0f0fd0204f2eac1.tar.bz2
Let IPC::SyncMessageFilter take advantage of thread-safe Send.
SyncMessageFilter is unnecessarily hopping to the IO thread before writing to its underlying Sender when the underlying Sender has a thread-safe Send implementation. This fixes that. BUG=516464 Review URL: https://codereview.chromium.org/1262253004 Cr-Commit-Position: refs/heads/master@{#342027}
Diffstat (limited to 'ipc/ipc_sync_channel.cc')
-rw-r--r--ipc/ipc_sync_channel.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc
index 35b88a7..845eccd 100644
--- a/ipc/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -460,6 +460,14 @@ void SyncChannel::SetRestrictDispatchChannelGroup(int group) {
sync_context()->set_restrict_dispatch_group(group);
}
+scoped_refptr<SyncMessageFilter> SyncChannel::CreateSyncMessageFilter() {
+ scoped_refptr<SyncMessageFilter> filter = new SyncMessageFilter(
+ sync_context()->shutdown_event(),
+ sync_context()->IsChannelSendThreadSafe());
+ AddFilter(filter.get());
+ return filter;
+}
+
bool SyncChannel::Send(Message* message) {
#ifdef IPC_MESSAGE_LOG_ENABLED
std::string name;