| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 THIRD_PARTY_MOJO_SRC_MOJO_EDK_JS_WAITING_CALLBACK_H_ | 5 #ifndef MOJO_EDK_JS_WAITING_CALLBACK_H_ |
| 6 #define THIRD_PARTY_MOJO_SRC_MOJO_EDK_JS_WAITING_CALLBACK_H_ | 6 #define MOJO_EDK_JS_WAITING_CALLBACK_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "gin/handle.h" | 9 #include "gin/handle.h" |
| 10 #include "gin/runner.h" | 10 #include "gin/runner.h" |
| 11 #include "gin/wrappable.h" | 11 #include "gin/wrappable.h" |
| 12 #include "mojo/edk/js/handle.h" |
| 13 #include "mojo/edk/js/handle_close_observer.h" |
| 12 #include "mojo/public/c/environment/async_waiter.h" | 14 #include "mojo/public/c/environment/async_waiter.h" |
| 13 #include "mojo/public/cpp/system/core.h" | 15 #include "mojo/public/cpp/system/core.h" |
| 14 #include "third_party/mojo/src/mojo/edk/js/handle.h" | |
| 15 #include "third_party/mojo/src/mojo/edk/js/handle_close_observer.h" | |
| 16 | 16 |
| 17 namespace mojo { | 17 namespace mojo { |
| 18 namespace js { | 18 namespace edk { |
| 19 | 19 |
| 20 class WaitingCallback : public gin::Wrappable<WaitingCallback>, | 20 class WaitingCallback : public gin::Wrappable<WaitingCallback>, |
| 21 public HandleCloseObserver { | 21 public HandleCloseObserver { |
| 22 public: | 22 public: |
| 23 static gin::WrapperInfo kWrapperInfo; | 23 static gin::WrapperInfo kWrapperInfo; |
| 24 | 24 |
| 25 // Creates a new WaitingCallback. | 25 // Creates a new WaitingCallback. |
| 26 static gin::Handle<WaitingCallback> Create( | 26 static gin::Handle<WaitingCallback> Create( |
| 27 v8::Isolate* isolate, | 27 v8::Isolate* isolate, |
| 28 v8::Handle<v8::Function> callback, | 28 v8::Handle<v8::Function> callback, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 55 | 55 |
| 56 base::WeakPtr<gin::Runner> runner_; | 56 base::WeakPtr<gin::Runner> runner_; |
| 57 MojoAsyncWaitID wait_id_; | 57 MojoAsyncWaitID wait_id_; |
| 58 | 58 |
| 59 HandleWrapper* handle_wrapper_; | 59 HandleWrapper* handle_wrapper_; |
| 60 base::WeakPtrFactory<WaitingCallback> weak_factory_; | 60 base::WeakPtrFactory<WaitingCallback> weak_factory_; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(WaitingCallback); | 62 DISALLOW_COPY_AND_ASSIGN(WaitingCallback); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace js | 65 } // namespace edk |
| 66 } // namespace mojo | 66 } // namespace mojo |
| 67 | 67 |
| 68 #endif // THIRD_PARTY_MOJO_SRC_MOJO_EDK_JS_WAITING_CALLBACK_H_ | 68 #endif // MOJO_EDK_JS_WAITING_CALLBACK_H_ |
| OLD | NEW |