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

Unified Diff: mojo/public/cpp/system/watcher.h

Issue 1811433002: [mojo-edk] Expose notification source to MojoWatch callbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: 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);

Powered by Google App Engine
This is Rietveld 408576698