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

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

Issue 2033243003: Use Mojo pipes to signal sync IPC events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gyp 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
80 private: 83 private:
81 class MessageLoopObserver; 84 class MessageLoopObserver;
82 friend class MessageLoopObserver; 85 friend class MessageLoopObserver;
83 86
84 void OnHandleReady(MojoResult result); 87 void OnHandleReady(MojoResult result);
85 88
86 static void CallOnHandleReady(uintptr_t context, 89 static void CallOnHandleReady(uintptr_t context,
87 MojoResult result, 90 MojoResult result,
88 MojoHandleSignalsState signals_state, 91 MojoHandleSignalsState signals_state,
89 MojoWatchNotificationFlags flags); 92 MojoWatchNotificationFlags flags);
(...skipping 23 matching lines...) Expand all
113 ReadyCallback callback_; 116 ReadyCallback callback_;
114 117
115 base::WeakPtrFactory<Watcher> weak_factory_; 118 base::WeakPtrFactory<Watcher> weak_factory_;
116 119
117 DISALLOW_COPY_AND_ASSIGN(Watcher); 120 DISALLOW_COPY_AND_ASSIGN(Watcher);
118 }; 121 };
119 122
120 } // namespace mojo 123 } // namespace mojo
121 124
122 #endif // MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_ 125 #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