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

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

Issue 113893005: [gin] Introduce Wrappable::GetObjectTemplate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates 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
« no previous file with comments | « mojo/apps/js/bindings/gl/opaque.cc ('k') | mojo/apps/js/bindings/waiting_callback.h » ('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 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 #include "mojo/apps/js/bindings/support.h" 5 #include "mojo/apps/js/bindings/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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } // namespace 47 } // namespace
48 48
49 const char Support::kModuleName[] = "mojo/apps/js/bindings/support"; 49 const char Support::kModuleName[] = "mojo/apps/js/bindings/support";
50 50
51 v8::Local<v8::ObjectTemplate> Support::GetTemplate(v8::Isolate* isolate) { 51 v8::Local<v8::ObjectTemplate> Support::GetTemplate(v8::Isolate* isolate) {
52 gin::PerIsolateData* data = gin::PerIsolateData::From(isolate); 52 gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
53 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate( 53 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate(
54 &g_wrapper_info); 54 &g_wrapper_info);
55 55
56 if (templ.IsEmpty()) { 56 if (templ.IsEmpty()) {
57 WaitingCallback::EnsureRegistered(isolate); 57 templ = gin::ObjectTemplateBuilder(isolate)
58 58 .SetMethod("asyncWait", AsyncWait)
59 templ = gin::ObjectTemplateBuilder(isolate) 59 .SetMethod("cancelWait", CancelWait)
60 .SetMethod("asyncWait", AsyncWait) 60 .Build();
61 .SetMethod("cancelWait", CancelWait)
62 .Build();
63 61
64 data->SetObjectTemplate(&g_wrapper_info, templ); 62 data->SetObjectTemplate(&g_wrapper_info, templ);
65 } 63 }
66 64
67 return templ; 65 return templ;
68 } 66 }
69 67
70 } // namespace js 68 } // namespace js
71 } // namespace mojo 69 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/apps/js/bindings/gl/opaque.cc ('k') | mojo/apps/js/bindings/waiting_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698