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

Unified Diff: ipc/ipc_sync_channel.cc

Issue 9917002: IPC: change sync channel dispatch restriction to allow dispatch to other channels within the same "… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: docs Created 8 years, 9 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_channel_unittest.cc » ('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 b331779622d858eace9791cc57c0ad1f82a94fbd..2763ebd3220134dd0f9a13de5deede583281053c 100644
--- a/ipc/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -103,8 +103,9 @@ class SyncChannel::ReceivedSyncMsgQueue :
first_time = false;
}
for (; it != message_queue_.end(); it++) {
- if (!it->context->restrict_dispatch() ||
- it->context == dispatching_context) {
+ int message_group = it->context->restrict_dispatch_group();
+ if (message_group == kRestrictDispatchGroup_None ||
+ message_group == dispatching_context->restrict_dispatch_group()) {
message = it->message;
context = it->context;
it = message_queue_.erase(it);
@@ -228,7 +229,7 @@ SyncChannel::SyncContext::SyncContext(
: ChannelProxy::Context(listener, ipc_thread),
received_sync_msgs_(ReceivedSyncMsgQueue::AddContext()),
shutdown_event_(shutdown_event),
- restrict_dispatch_(false) {
+ restrict_dispatch_group_(kRestrictDispatchGroup_None) {
}
SyncChannel::SyncContext::~SyncContext() {
@@ -408,8 +409,8 @@ SyncChannel::SyncChannel(
SyncChannel::~SyncChannel() {
}
-void SyncChannel::SetRestrictDispatchToSameChannel(bool value) {
- sync_context()->set_restrict_dispatch(value);
+void SyncChannel::SetRestrictDispatchChannelGroup(int group) {
+ sync_context()->set_restrict_dispatch_group(group);
}
bool SyncChannel::Send(Message* message) {
« no previous file with comments | « ipc/ipc_sync_channel.h ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698