Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: mojo/apps/js/bindings/waiting_callback.h

Issue 111083005: Beginning of JS Mojo API to GL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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_APPS_JS_BINDINGS_WAITING_CALLBACK_H_ 5 #ifndef MOJO_APPS_JS_BINDINGS_WAITING_CALLBACK_H_
6 #define MOJO_APPS_JS_BINDINGS_WAITING_CALLBACK_H_ 6 #define MOJO_APPS_JS_BINDINGS_WAITING_CALLBACK_H_
7 7
8 #include "gin/handle.h" 8 #include "gin/handle.h"
9 #include "gin/runner.h" 9 #include "gin/runner.h"
10 #include "gin/wrappable.h" 10 #include "gin/wrappable.h"
11 #include "mojo/public/bindings/lib/bindings_support.h" 11 #include "mojo/public/bindings/lib/bindings_support.h"
12 12
13 namespace mojo { 13 namespace mojo {
14 namespace js { 14 namespace js {
15 15
16 class WaitingCallback : public gin::Wrappable<WaitingCallback>, 16 class WaitingCallback : public gin::Wrappable<WaitingCallback>,
17 public BindingsSupport::AsyncWaitCallback { 17 public BindingsSupport::AsyncWaitCallback {
18 public: 18 public:
19 static gin::WrapperInfo kWrapperInfo;
20
19 static gin::Handle<WaitingCallback> Create( 21 static gin::Handle<WaitingCallback> Create(
20 v8::Isolate* isolate, v8::Handle<v8::Function> callback); 22 v8::Isolate* isolate, v8::Handle<v8::Function> callback);
21 23
22 static void EnsureRegistered(v8::Isolate* isolate); 24 static void EnsureRegistered(v8::Isolate* isolate);
23 25
24 BindingsSupport::AsyncWaitID wait_id() const { 26 BindingsSupport::AsyncWaitID wait_id() const {
25 return wait_id_; 27 return wait_id_;
26 } 28 }
27 29
28 void set_wait_id(BindingsSupport::AsyncWaitID wait_id) { 30 void set_wait_id(BindingsSupport::AsyncWaitID wait_id) {
29 wait_id_ = wait_id; 31 wait_id_ = wait_id;
30 } 32 }
31 33
32 private: 34 private:
33 WaitingCallback(v8::Isolate* isolate, v8::Handle<v8::Function> callback); 35 WaitingCallback(v8::Isolate* isolate, v8::Handle<v8::Function> callback);
34 virtual ~WaitingCallback(); 36 virtual ~WaitingCallback();
35 37
36 virtual void OnHandleReady(MojoResult result) OVERRIDE; 38 virtual void OnHandleReady(MojoResult result) OVERRIDE;
37 39
38 base::WeakPtr<gin::Runner> runner_; 40 base::WeakPtr<gin::Runner> runner_;
39 BindingsSupport::AsyncWaitID wait_id_; 41 BindingsSupport::AsyncWaitID wait_id_;
40 42
41 DISALLOW_COPY_AND_ASSIGN(WaitingCallback); 43 DISALLOW_COPY_AND_ASSIGN(WaitingCallback);
42 }; 44 };
43 45
44 } // namespace js 46 } // namespace js
45 } // namespace mojo 47 } // namespace mojo
46 48
47 #endif // MOJO_APPS_JS_BINDINGS_WAITING_CALLBACK_H_ 49 #endif // MOJO_APPS_JS_BINDINGS_WAITING_CALLBACK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698