Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MOJO_EDK_SYSTEM_ASYNC_WAITER_H_ | |
| 6 #define MOJO_EDK_SYSTEM_ASYNC_WAITER_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "base/memory/ref_counted.h" | |
|
viettrungluu
2014/12/12 21:39:30
Don't need this include.
gmorrita
2014/12/12 22:56:27
Done.
| |
| 11 #include "mojo/edk/system/awakable.h" | |
| 12 #include "mojo/edk/system/dispatcher.h" | |
|
viettrungluu
2014/12/12 21:39:31
Nor this.
gmorrita
2014/12/12 22:56:27
Done.
| |
| 13 #include "mojo/edk/system/handle_signals_state.h" | |
|
viettrungluu
2014/12/12 21:39:31
"
gmorrita
2014/12/12 22:56:27
Done.
| |
| 14 #include "mojo/edk/system/system_impl_export.h" | |
| 15 #include "mojo/public/c/system/types.h" | |
| 16 | |
| 17 namespace mojo { | |
| 18 namespace system { | |
| 19 | |
| 20 // An |Awakable| implementation that just calls a given callback object. | |
| 21 class MOJO_SYSTEM_IMPL_EXPORT AsyncWaiter : public Awakable { | |
| 22 public: | |
| 23 typedef base::Callback<void(MojoResult)> AwakeCallback; | |
| 24 | |
| 25 // |callback| must satisfy the same contract as |Awakable::Awake()|. | |
| 26 AsyncWaiter(AwakeCallback callback); | |
|
viettrungluu
2014/12/12 21:39:31
explicit
gmorrita
2014/12/12 22:56:28
Done.
| |
| 27 virtual ~AsyncWaiter(); | |
|
viettrungluu
2014/12/12 21:39:31
This doesn't need to be virtual. (Possibly, you sh
gmorrita
2014/12/12 22:56:27
Our clang plugin complains about this :-/
| |
| 28 | |
| 29 private: | |
| 30 // |Awakable| implementation: | |
| 31 bool Awake(MojoResult result, uintptr_t context) override; | |
| 32 | |
| 33 AwakeCallback callback_; | |
| 34 | |
| 35 DISALLOW_COPY_AND_ASSIGN(AsyncWaiter); | |
| 36 }; | |
| 37 | |
| 38 } // namespace system | |
| 39 } // namespace mojo | |
| 40 | |
| 41 #endif // MOJO_EDK_SYSTEM_ASYNC_WAITER_H_ | |
| OLD | NEW |