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

Unified Diff: ipc/ipc_sync_channel.h

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: 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
Index: ipc/ipc_sync_channel.h
diff --git a/ipc/ipc_sync_channel.h b/ipc/ipc_sync_channel.h
index 448d355fbce680068bafbce346b484396140161f..793903e9449e72992ff70c930c869e48ff9cf192 100644
--- a/ipc/ipc_sync_channel.h
+++ b/ipc/ipc_sync_channel.h
@@ -88,16 +88,16 @@ class IPC_EXPORT SyncChannel : public ChannelProxy,
sync_messages_with_no_timeout_allowed_ = value;
}
- // Sets this channel to only dispatch its incoming unblocking messages when it
- // is itself blocked on sending a sync message, not when other channels are.
+ // Sets the dispatch group for this channel, to only allow re-entrant dispatch
+ // of messages to other channels in the same group.
//
// Normally, any unblocking message coming from any channel can be dispatched
// when any (possibly other) channel is blocked on sending a message. This is
// needed in some cases to unblock certain loops (e.g. necessary when some
// processes share a window hierarchy), but may cause re-entrancy issues in
// some cases where such loops are not possible. This flags allows the tagging
- // of some particular channels to not re-enter in such cases.
- void SetRestrictDispatchToSameChannel(bool value);
+ // of some particular channels to only re-enter in known correct cases.
+ void SetRestrictDispatchChannelGroup(int group);
protected:
class ReceivedSyncMsgQueue;
@@ -146,8 +146,13 @@ class IPC_EXPORT SyncChannel : public ChannelProxy,
return received_sync_msgs_;
}
- void set_restrict_dispatch(bool value) { restrict_dispatch_ = value; }
- bool restrict_dispatch() const { return restrict_dispatch_; }
+ void set_restrict_dispatch_group(int group) {
+ restrict_dispatch_group_ = group;
+ }
+
+ int restrict_dispatch_group() const {
+ return restrict_dispatch_group_;
+ }
private:
virtual ~SyncContext();
@@ -176,7 +181,7 @@ class IPC_EXPORT SyncChannel : public ChannelProxy,
base::WaitableEvent* shutdown_event_;
base::WaitableEventWatcher shutdown_watcher_;
- bool restrict_dispatch_;
+ int restrict_dispatch_group_;
};
private:

Powered by Google App Engine
This is Rietveld 408576698