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

Unified Diff: mojo/common/handle_watcher.h

Issue 282823003: Mojo: cancel pending AsyncWait calls when the callers thread exits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: env first Created 6 years, 7 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 | « mojo/apps/js/test/js_to_cpp_unittest.cc ('k') | mojo/common/handle_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/handle_watcher.h
diff --git a/mojo/common/handle_watcher.h b/mojo/common/handle_watcher.h
index aa151dc0eeb96a8881d54212a81f2057abd1f93c..0660abb9effbc6148a88e8ce3d07f45f17e81e67 100644
--- a/mojo/common/handle_watcher.h
+++ b/mojo/common/handle_watcher.h
@@ -33,7 +33,9 @@ class MOJO_COMMON_EXPORT HandleWatcher {
// words, Start() performs one asynchronous watch at a time. It is ok to call
// Start() multiple times, but it cancels any existing watches. |callback| is
// notified when the handle is ready, invalid or deadline has passed and is
- // notified on the thread Start() was invoked on.
+ // notified on the thread Start() was invoked on. If the current thread exits
+ // before the handle is ready, then |callback| is invoked with a result of
+ // MOJO_RESULT_ABORTED.
void Start(const Handle& handle,
MojoWaitFlags wait_flags,
MojoDeadline deadline,
@@ -43,13 +45,10 @@ class MOJO_COMMON_EXPORT HandleWatcher {
void Stop();
private:
- struct StartState;
-
- // See description of |StartState::weak_factory| for details.
- void OnHandleReady(MojoResult result);
+ class State;
// If non-NULL Start() has been invoked.
- scoped_ptr<StartState> start_state_;
+ scoped_ptr<State> state_;
DISALLOW_COPY_AND_ASSIGN(HandleWatcher);
};
« no previous file with comments | « mojo/apps/js/test/js_to_cpp_unittest.cc ('k') | mojo/common/handle_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698