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

Side by Side Diff: mojo/message_pump/handle_watcher.h

Issue 1722543003: Mojo bindings environment: remove usage in mojo/edk/js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « mojo/edk/js/waiting_callback.cc ('k') | mojo/mojo_base.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_ 5 #ifndef MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_
6 #define MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_ 6 #define MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 27 matching lines...) Expand all
38 // before the handle is ready, then |callback| is invoked with a result of 38 // before the handle is ready, then |callback| is invoked with a result of
39 // MOJO_RESULT_ABORTED. 39 // MOJO_RESULT_ABORTED.
40 void Start(const Handle& handle, 40 void Start(const Handle& handle,
41 MojoHandleSignals handle_signals, 41 MojoHandleSignals handle_signals,
42 MojoDeadline deadline, 42 MojoDeadline deadline,
43 const base::Callback<void(MojoResult)>& callback); 43 const base::Callback<void(MojoResult)>& callback);
44 44
45 // Stops listening. Does nothing if not in the process of listening. 45 // Stops listening. Does nothing if not in the process of listening.
46 void Stop(); 46 void Stop();
47 47
48 bool is_watching() const { return !!state_; }
49
48 private: 50 private:
49 class StateBase; 51 class StateBase;
50 class SameThreadWatchingState; 52 class SameThreadWatchingState;
51 class SecondaryThreadWatchingState; 53 class SecondaryThreadWatchingState;
52 54
53 // If non-NULL Start() has been invoked. 55 // If non-NULL Start() has been invoked.
54 scoped_ptr<StateBase> state_; 56 scoped_ptr<StateBase> state_;
55 57
56 DISALLOW_COPY_AND_ASSIGN(HandleWatcher); 58 DISALLOW_COPY_AND_ASSIGN(HandleWatcher);
57 }; 59 };
58 60
59 } // namespace common 61 } // namespace common
60 } // namespace mojo 62 } // namespace mojo
61 63
62 #endif // MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_ 64 #endif // MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_
OLDNEW
« no previous file with comments | « mojo/edk/js/waiting_callback.cc ('k') | mojo/mojo_base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698