| 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" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 class Context; | 25 class Context; |
| 26 | 26 |
| 27 explicit AsyncHandleWaiter(base::Callback<void(MojoResult)> callback); | 27 explicit AsyncHandleWaiter(base::Callback<void(MojoResult)> callback); |
| 28 ~AsyncHandleWaiter(); | 28 ~AsyncHandleWaiter(); |
| 29 | 29 |
| 30 MojoResult Wait(MojoHandle handle, MojoHandleSignals signals); | 30 MojoResult Wait(MojoHandle handle, MojoHandleSignals signals); |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 void InvokeCallback(MojoResult result); | 33 void InvokeCallback(MojoResult result); |
| 34 | 34 |
| 35 base::WeakPtrFactory<AsyncHandleWaiter> weak_factory_; | |
| 36 scoped_refptr<Context> context_; | 35 scoped_refptr<Context> context_; |
| 37 base::Callback<void(MojoResult)> callback_; | 36 base::Callback<void(MojoResult)> callback_; |
| 37 base::WeakPtrFactory<AsyncHandleWaiter> weak_factory_; |
| 38 | 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(AsyncHandleWaiter); | 39 DISALLOW_COPY_AND_ASSIGN(AsyncHandleWaiter); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // namespace internal | 42 } // namespace internal |
| 43 } // namespace IPC | 43 } // namespace IPC |
| 44 | 44 |
| 45 #endif // IPC_MOJO_ASYNC_HANDLE_WAITER_H_ | 45 #endif // IPC_MOJO_ASYNC_HANDLE_WAITER_H_ |
| OLD | NEW |