| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 IPC_MOJO_ASYNC_HANDLE_WAITER_H_ | 5 #ifndef IPC_MOJO_ASYNC_HANDLE_WAITER_H_ |
| 6 #define IPC_MOJO_ASYNC_HANDLE_WAITER_H_ | 6 #define IPC_MOJO_ASYNC_HANDLE_WAITER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "ipc/ipc_export.h" | 11 #include "ipc/ipc_export.h" |
| 12 #include "mojo/public/c/system/types.h" | 12 #include "third_party/mojo/src/mojo/public/c/system/types.h" |
| 13 | 13 |
| 14 namespace IPC { | 14 namespace IPC { |
| 15 namespace internal { | 15 namespace internal { |
| 16 | 16 |
| 17 // |AsyncHandleWaiter| waits on a mojo handle asynchronously and | 17 // |AsyncHandleWaiter| waits on a mojo handle asynchronously and |
| 18 // invokes the given |callback| through |runner| when it is signaled. | 18 // invokes the given |callback| through |runner| when it is signaled. |
| 19 // * To start waiting, the client must call |AsyncHandleWaiter::Wait()|. | 19 // * To start waiting, the client must call |AsyncHandleWaiter::Wait()|. |
| 20 // The client can call |Wait()| again once it is signaled and | 20 // The client can call |Wait()| again once it is signaled and |
| 21 // the |callback| is invoked. | 21 // the |callback| is invoked. |
| 22 // * To cancel waiting, delete the instance. | 22 // * To cancel waiting, delete the instance. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 39 base::Callback<void(MojoResult)> callback_; | 39 base::Callback<void(MojoResult)> callback_; |
| 40 base::WeakPtrFactory<AsyncHandleWaiter> weak_factory_; | 40 base::WeakPtrFactory<AsyncHandleWaiter> weak_factory_; |
| 41 | 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(AsyncHandleWaiter); | 42 DISALLOW_COPY_AND_ASSIGN(AsyncHandleWaiter); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace internal | 45 } // namespace internal |
| 46 } // namespace IPC | 46 } // namespace IPC |
| 47 | 47 |
| 48 #endif // IPC_MOJO_ASYNC_HANDLE_WAITER_H_ | 48 #endif // IPC_MOJO_ASYNC_HANDLE_WAITER_H_ |
| OLD | NEW |