| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/thread_task_runner_handle.h" | |
| 16 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
| 16 #include "base/threading/thread_task_runner_handle.h" |
| 17 #include "mojo/public/c/system/types.h" | 17 #include "mojo/public/c/system/types.h" |
| 18 #include "mojo/public/cpp/system/handle.h" | 18 #include "mojo/public/cpp/system/handle.h" |
| 19 | 19 |
| 20 namespace mojo { | 20 namespace mojo { |
| 21 | 21 |
| 22 // A Watcher watches a single Mojo handle for signal state changes. | 22 // A Watcher watches a single Mojo handle for signal state changes. |
| 23 // | 23 // |
| 24 // NOTE: Watchers may only be used on threads which have a running MessageLoop. | 24 // NOTE: Watchers may only be used on threads which have a running MessageLoop. |
| 25 class Watcher { | 25 class Watcher { |
| 26 public: | 26 public: |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 ReadyCallback callback_; | 113 ReadyCallback callback_; |
| 114 | 114 |
| 115 base::WeakPtrFactory<Watcher> weak_factory_; | 115 base::WeakPtrFactory<Watcher> weak_factory_; |
| 116 | 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(Watcher); | 117 DISALLOW_COPY_AND_ASSIGN(Watcher); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace mojo | 120 } // namespace mojo |
| 121 | 121 |
| 122 #endif // MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_ | 122 #endif // MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_ |
| OLD | NEW |