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

Side by Side Diff: mojo/bindings/js/support.cc

Issue 708563002: Move mojo/public/js/bindings/ moves to mojo/public/js/ (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Sync again Created 6 years, 1 month 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
« no previous file with comments | « mojo/bindings/js/core.cc ('k') | mojo/bindings/js/tests/run_js_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "mojo/bindings/js/support.h" 5 #include "mojo/bindings/js/support.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "gin/arguments.h" 8 #include "gin/arguments.h"
9 #include "gin/converter.h" 9 #include "gin/converter.h"
10 #include "gin/function_template.h" 10 #include "gin/function_template.h"
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 void CancelWait(WaitingCallback* waiting_callback) { 32 void CancelWait(WaitingCallback* waiting_callback) {
33 waiting_callback->Cancel(); 33 waiting_callback->Cancel();
34 } 34 }
35 35
36 gin::WrapperInfo g_wrapper_info = { gin::kEmbedderNativeGin }; 36 gin::WrapperInfo g_wrapper_info = { gin::kEmbedderNativeGin };
37 37
38 } // namespace 38 } // namespace
39 39
40 const char Support::kModuleName[] = "mojo/public/js/bindings/support"; 40 const char Support::kModuleName[] = "mojo/public/js/support";
41 41
42 v8::Local<v8::Value> Support::GetModule(v8::Isolate* isolate) { 42 v8::Local<v8::Value> Support::GetModule(v8::Isolate* isolate) {
43 gin::PerIsolateData* data = gin::PerIsolateData::From(isolate); 43 gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
44 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate( 44 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate(
45 &g_wrapper_info); 45 &g_wrapper_info);
46 46
47 if (templ.IsEmpty()) { 47 if (templ.IsEmpty()) {
48 templ = gin::ObjectTemplateBuilder(isolate) 48 templ = gin::ObjectTemplateBuilder(isolate)
49 .SetMethod("asyncWait", AsyncWait) 49 .SetMethod("asyncWait", AsyncWait)
50 .SetMethod("cancelWait", CancelWait) 50 .SetMethod("cancelWait", CancelWait)
51 .Build(); 51 .Build();
52 52
53 data->SetObjectTemplate(&g_wrapper_info, templ); 53 data->SetObjectTemplate(&g_wrapper_info, templ);
54 } 54 }
55 55
56 return templ->NewInstance(); 56 return templ->NewInstance();
57 } 57 }
58 58
59 } // namespace js 59 } // namespace js
60 } // namespace mojo 60 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/bindings/js/core.cc ('k') | mojo/bindings/js/tests/run_js_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698