| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |