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

Unified Diff: ipc/ipc_sync_channel.h

Issue 6810013: Add sync context dispatch restriction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 8 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 0386b8f41b049b4da6c367dd1f7be8baed45f2d7..c551be2bee11b5094f71459f64872d2ec23571d6 100644
--- a/ipc/ipc_sync_channel.h
+++ b/ipc/ipc_sync_channel.h
@@ -51,6 +51,18 @@ class 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.
+ //
+ // 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.
+ // renderer->browser->plugin->renderer), but may cause re-entrancy issues in
+ // some cases where loops are not possible (e.g. dispatching a ppapi message
+ // while the renderer is blocked on the gpu). This flags allows the tagging of
+ // some particular channels (e.g. ppapi) to not re-enter in such cases.
jam 2011/04/07 21:25:19 nit: we've usually tried to stay away from talking
+ void SetRestrictDispatchToSameChannel(bool value);
+
protected:
class ReceivedSyncMsgQueue;
friend class ReceivedSyncMsgQueue;
@@ -98,6 +110,9 @@ class SyncChannel : public ChannelProxy,
return received_sync_msgs_;
}
+ void set_restrict_dispatch(bool value) { restrict_dispatch_ = value; }
+ bool restrict_dispatch() const { return restrict_dispatch_; }
+
private:
~SyncContext();
// ChannelProxy methods that we override.
@@ -125,6 +140,7 @@ class SyncChannel : public ChannelProxy,
base::WaitableEvent* shutdown_event_;
base::WaitableEventWatcher shutdown_watcher_;
+ bool restrict_dispatch_;
};
private:

Powered by Google App Engine
This is Rietveld 408576698