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

Side by Side Diff: mojo/public/cpp/system/watcher.h

Issue 2067233002: Revert of Use Mojo pipes to signal sync IPC events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/public/cpp/bindings/sync_handle_registry.h ('k') | ppapi/BUILD.gn » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_PUBLIC_CPP_SYSTEM_WATCHER_H_ 5 #ifndef MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_
6 #define MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_ 6 #define MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // 70 //
71 // Destroying the Watcher implicitly calls |Cancel()|. 71 // Destroying the Watcher implicitly calls |Cancel()|.
72 MojoResult Start(Handle handle, 72 MojoResult Start(Handle handle,
73 MojoHandleSignals signals, 73 MojoHandleSignals signals,
74 const ReadyCallback& callback); 74 const ReadyCallback& callback);
75 75
76 // Cancels the current watch. Once this returns, the callback previously 76 // Cancels the current watch. Once this returns, the callback previously
77 // passed to |Start()| will never be called again for this Watcher. 77 // passed to |Start()| will never be called again for this Watcher.
78 void Cancel(); 78 void Cancel();
79 79
80 Handle handle() const { return handle_; }
81 ReadyCallback ready_callback() const { return callback_; }
82
83 private: 80 private:
84 class MessageLoopObserver; 81 class MessageLoopObserver;
85 friend class MessageLoopObserver; 82 friend class MessageLoopObserver;
86 83
87 void OnHandleReady(MojoResult result); 84 void OnHandleReady(MojoResult result);
88 85
89 static void CallOnHandleReady(uintptr_t context, 86 static void CallOnHandleReady(uintptr_t context,
90 MojoResult result, 87 MojoResult result,
91 MojoHandleSignalsState signals_state, 88 MojoHandleSignalsState signals_state,
92 MojoWatchNotificationFlags flags); 89 MojoWatchNotificationFlags flags);
(...skipping 23 matching lines...) Expand all
116 ReadyCallback callback_; 113 ReadyCallback callback_;
117 114
118 base::WeakPtrFactory<Watcher> weak_factory_; 115 base::WeakPtrFactory<Watcher> weak_factory_;
119 116
120 DISALLOW_COPY_AND_ASSIGN(Watcher); 117 DISALLOW_COPY_AND_ASSIGN(Watcher);
121 }; 118 };
122 119
123 } // namespace mojo 120 } // namespace mojo
124 121
125 #endif // MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_ 122 #endif // MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/sync_handle_registry.h ('k') | ppapi/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698