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

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

Issue 1811433002: [mojo-edk] Expose notification source to MojoWatch callbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 void Cancel(); 77 void Cancel();
78 78
79 private: 79 private:
80 class MessageLoopObserver; 80 class MessageLoopObserver;
81 friend class MessageLoopObserver; 81 friend class MessageLoopObserver;
82 82
83 void OnHandleReady(MojoResult result); 83 void OnHandleReady(MojoResult result);
84 84
85 static void CallOnHandleReady(uintptr_t context, 85 static void CallOnHandleReady(uintptr_t context,
86 MojoResult result, 86 MojoResult result,
87 MojoHandleSignalsState signals_state); 87 MojoHandleSignalsState signals_state,
88 MojoWatchNotificationFlags flags);
88 89
89 base::ThreadChecker thread_checker_; 90 base::ThreadChecker thread_checker_;
90 91
91 // The TaskRunner of this Watcher's owning thread. This field is safe to 92 // The TaskRunner of this Watcher's owning thread. This field is safe to
92 // access from any thread. 93 // access from any thread.
93 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 94 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
94 95
95 scoped_ptr<MessageLoopObserver> message_loop_observer_; 96 scoped_ptr<MessageLoopObserver> message_loop_observer_;
96 97
97 // A persistent weak reference to this Watcher which can be passed to the 98 // A persistent weak reference to this Watcher which can be passed to the
(...skipping 10 matching lines...) Expand all
108 ReadyCallback callback_; 109 ReadyCallback callback_;
109 110
110 base::WeakPtrFactory<Watcher> weak_factory_; 111 base::WeakPtrFactory<Watcher> weak_factory_;
111 112
112 DISALLOW_COPY_AND_ASSIGN(Watcher); 113 DISALLOW_COPY_AND_ASSIGN(Watcher);
113 }; 114 };
114 115
115 } // namespace mojo 116 } // namespace mojo
116 117
117 #endif // MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_ 118 #endif // MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698