Index: mojo/public/cpp/system/watcher.h |
diff --git a/mojo/public/cpp/system/watcher.h b/mojo/public/cpp/system/watcher.h |
index cd068aad0b4a6adec6331980aab7dbebc14497d0..6efc700b98a443e2b777bff3d932cf407afe066f 100644 |
--- a/mojo/public/cpp/system/watcher.h |
+++ b/mojo/public/cpp/system/watcher.h |
@@ -48,6 +48,11 @@ class Watcher { |
// still active. |
~Watcher(); |
+ // Allows the watcher to dispatch notifications synchronously if notified on |
+ // its own thread. This should be used with caution since it means watched |
+ // endpoints may reenter each other. |
+ void SetAllowSyncDispatch(bool allowed); |
+ |
// Indicates if the Watcher is currently watching a handle. |
bool IsWatching() const; |
@@ -107,6 +112,8 @@ class Watcher { |
// The callback to call when the handle is signaled. |
ReadyCallback callback_; |
+ bool allow_sync_dispatch_ = false; |
+ |
base::WeakPtrFactory<Watcher> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(Watcher); |