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

Side by Side Diff: mojo/edk/js/threading.cc

Issue 728043002: Revert of Update mojo sdk to rev afb4440fd5a10cba980878c326180b7ad7960480 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/edk/js/threading.h ('k') | mojo/edk/js/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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "mojo/edk/js/threading.h"
6
7 #include "base/message_loop/message_loop.h"
8 #include "gin/object_template_builder.h"
9 #include "gin/per_isolate_data.h"
10 #include "mojo/edk/js/handle.h"
11
12 namespace mojo {
13 namespace js {
14
15 namespace {
16
17 void Quit() {
18 base::MessageLoop::current()->QuitNow();
19 }
20
21 gin::WrapperInfo g_wrapper_info = { gin::kEmbedderNativeGin };
22
23 } // namespace
24
25 const char Threading::kModuleName[] = "mojo/public/js/threading";
26
27 v8::Local<v8::Value> Threading::GetModule(v8::Isolate* isolate) {
28 gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
29 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate(
30 &g_wrapper_info);
31
32 if (templ.IsEmpty()) {
33 templ = gin::ObjectTemplateBuilder(isolate)
34 .SetMethod("quit", Quit)
35 .Build();
36
37 data->SetObjectTemplate(&g_wrapper_info, templ);
38 }
39
40 return templ->NewInstance();
41 }
42
43 Threading::Threading() {
44 }
45
46 } // namespace js
47 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/js/threading.h ('k') | mojo/edk/js/waiting_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698