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

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

Issue 506353002: Make HandleWatcher watch on the same thread if the thread is running a MessagePumpMojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated unittests Created 6 years, 3 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 | « no previous file | mojo/common/handle_watcher.cc » ('j') | mojo/common/handle_watcher_unittest.cc » ('J')
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_COMMON_HANDLE_WATCHER_H_ 5 #ifndef MOJO_COMMON_HANDLE_WATCHER_H_
6 #define MOJO_COMMON_HANDLE_WATCHER_H_ 6 #define MOJO_COMMON_HANDLE_WATCHER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback_forward.h" 9 #include "base/callback_forward.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 30 matching lines...) Expand all
41 void Start(const Handle& handle, 41 void Start(const Handle& handle,
42 MojoHandleSignals handle_signals, 42 MojoHandleSignals handle_signals,
43 MojoDeadline deadline, 43 MojoDeadline deadline,
44 const base::Callback<void(MojoResult)>& callback); 44 const base::Callback<void(MojoResult)>& callback);
45 45
46 // Stops listening. Does nothing if not in the process of listening. Blocks 46 // Stops listening. Does nothing if not in the process of listening. Blocks
47 // until no longer listening on the handle. 47 // until no longer listening on the handle.
48 void Stop(); 48 void Stop();
49 49
50 private: 50 private:
51 class State; 51 class StateBase;
52 class SameThreadWatchingState;
53 class SecondaryThreadWatchingState;
52 54
53 // If non-NULL Start() has been invoked. 55 // If non-NULL Start() has been invoked.
54 scoped_ptr<State> 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_COMMON_HANDLE_WATCHER_H_ 64 #endif // MOJO_COMMON_HANDLE_WATCHER_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/common/handle_watcher.cc » ('j') | mojo/common/handle_watcher_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698