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

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

Issue 100573003: [Mojo] Move JS bindings out of public (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix header guards 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/threading.h ('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/threading.h" 5 #include "mojo/apps/js/bindings/threading.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "gin/function_template.h" 9 #include "gin/function_template.h"
10 #include "gin/object_template_builder.h" 10 #include "gin/object_template_builder.h"
11 #include "gin/per_isolate_data.h" 11 #include "gin/per_isolate_data.h"
12 #include "mojo/public/bindings/js/handle.h" 12 #include "mojo/apps/js/bindings/handle.h"
13 13
14 namespace mojo { 14 namespace mojo {
15 namespace apps { 15 namespace apps {
16 16
17 namespace { 17 namespace {
18 18
19 void Quit() { 19 void Quit() {
20 base::MessageLoop::current()->QuitNow(); 20 base::MessageLoop::current()->QuitNow();
21 } 21 }
22 22
23 gin::WrapperInfo g_wrapper_info = { gin::kEmbedderNativeGin }; 23 gin::WrapperInfo g_wrapper_info = { gin::kEmbedderNativeGin };
24 24
25 } // namespace 25 } // namespace
26 26
27 const char Threading::kModuleName[] = "mojo/apps/js/threading"; 27 const char Threading::kModuleName[] = "mojo/apps/js/bindings/threading";
28 28
29 v8::Local<v8::ObjectTemplate> Threading::GetTemplate(v8::Isolate* isolate) { 29 v8::Local<v8::ObjectTemplate> Threading::GetTemplate(v8::Isolate* isolate) {
30 gin::PerIsolateData* data = gin::PerIsolateData::From(isolate); 30 gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
31 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate( 31 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate(
32 &g_wrapper_info); 32 &g_wrapper_info);
33 33
34 if (templ.IsEmpty()) { 34 if (templ.IsEmpty()) {
35 templ = gin::ObjectTemplateBuilder(isolate) 35 templ = gin::ObjectTemplateBuilder(isolate)
36 .SetMethod("quit", Quit) 36 .SetMethod("quit", Quit)
37 .Build(); 37 .Build();
38 38
39 data->SetObjectTemplate(&g_wrapper_info, templ); 39 data->SetObjectTemplate(&g_wrapper_info, templ);
40 } 40 }
41 41
42 return templ; 42 return templ;
43 } 43 }
44 44
45 } // namespace apps 45 } // namespace apps
46 } // namespace mojo 46 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/apps/js/bindings/threading.h ('k') | mojo/apps/js/bindings/waiting_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698