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

Side by Side Diff: mojo/apps/js/bindings/gl/module.cc

Issue 646943006: Remove mojo/apps/js, it is unused (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/apps/js/bindings/gl/module.h ('k') | mojo/apps/js/bindings/monotonic_clock.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/apps/js/bindings/gl/module.h"
6
7 #include "base/logging.h"
8 #include "gin/arguments.h"
9 #include "gin/object_template_builder.h"
10 #include "gin/per_isolate_data.h"
11 #include "gin/wrappable.h"
12 #include "mojo/apps/js/bindings/gl/context.h"
13 #include "mojo/bindings/js/handle.h"
14
15 namespace mojo {
16 namespace js {
17 namespace gl {
18
19 const char* kModuleName = "mojo/apps/js/bindings/gl";
20
21 namespace {
22
23 gin::WrapperInfo kWrapperInfo = { gin::kEmbedderNativeGin };
24
25 gin::Handle<Context> CreateContext(
26 const gin::Arguments& args,
27 mojo::Handle handle,
28 v8::Handle<v8::Function> context_lost_callback) {
29 return Context::Create(args.isolate(), handle, context_lost_callback);
30 }
31
32 } // namespace
33
34 v8::Local<v8::Value> GetModule(v8::Isolate* isolate) {
35 gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
36 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate(&kWrapperInfo);
37
38 if (templ.IsEmpty()) {
39 templ = gin::ObjectTemplateBuilder(isolate)
40 .SetMethod("Context", CreateContext)
41 .Build();
42 data->SetObjectTemplate(&kWrapperInfo, templ);
43 }
44
45 return templ->NewInstance();
46 }
47
48 } // namespace gl
49 } // namespace js
50 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/apps/js/bindings/gl/module.h ('k') | mojo/apps/js/bindings/monotonic_clock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698