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

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

Issue 2754863002: Mojo: Don't hold a watch context ref in SimpleWatcher posted task (Closed)
Patch Set: . Created 3 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 | « no previous file | mojo/public/cpp/system/simple_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/system/simple_watcher.h
diff --git a/mojo/public/cpp/system/simple_watcher.h b/mojo/public/cpp/system/simple_watcher.h
index 5e5a7ea3a101a24eb8b1b293f32cf8554cc0cf0c..9001884c97360658648098eadde93057d88aab25 100644
--- a/mojo/public/cpp/system/simple_watcher.h
+++ b/mojo/public/cpp/system/simple_watcher.h
@@ -164,7 +164,7 @@ class MOJO_CPP_SYSTEM_EXPORT SimpleWatcher {
private:
class Context;
- void OnHandleReady(scoped_refptr<const Context> context, MojoResult result);
+ void OnHandleReady(int watch_id, MojoResult result);
base::ThreadChecker thread_checker_;
@@ -190,6 +190,10 @@ class MOJO_CPP_SYSTEM_EXPORT SimpleWatcher {
// The handle currently under watch. Not owned.
Handle handle_;
+ // A simple counter to disambiguate notifications from multiple watch contexts
+ // in the event that this SimpleWatcher cancels and watches multiple times.
+ int watch_id_ = 0;
+
// The callback to call when the handle is signaled.
ReadyCallback callback_;
« no previous file with comments | « no previous file | mojo/public/cpp/system/simple_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698