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

Side by Side Diff: services/js/js_app_runner_delegate.cc

Issue 788863003: Restore the JS Spinning Cube demo (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Removed spurious includes Created 6 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
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 "services/js/js_app_runner_delegate.h" 5 #include "services/js/js_app_runner_delegate.h"
6 6
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "gin/modules/console.h" 8 #include "gin/modules/console.h"
9 #include "gin/modules/timer.h"
9 #include "mojo/edk/js/core.h" 10 #include "mojo/edk/js/core.h"
10 #include "mojo/edk/js/handle.h" 11 #include "mojo/edk/js/handle.h"
11 #include "mojo/edk/js/support.h" 12 #include "mojo/edk/js/support.h"
12 #include "mojo/edk/js/threading.h" 13 #include "mojo/edk/js/threading.h"
13 #include "services/js/modules/clock/monotonic_clock.h" 14 #include "services/js/modules/clock/monotonic_clock.h"
14 #include "services/js/modules/gl/module.h" 15 #include "services/js/modules/gl/module.h"
15 16
16 namespace js { 17 namespace js {
17 18
18 namespace { 19 namespace {
(...skipping 10 matching lines...) Expand all
29 template<typename T> 30 template<typename T>
30 void AddBuiltin(gin::ModuleRunnerDelegate* delegate) { 31 void AddBuiltin(gin::ModuleRunnerDelegate* delegate) {
31 delegate->AddBuiltinModule(T::kModuleName, T::GetModule); 32 delegate->AddBuiltinModule(T::kModuleName, T::GetModule);
32 } 33 }
33 34
34 } // namespace 35 } // namespace
35 36
36 JSAppRunnerDelegate::JSAppRunnerDelegate() 37 JSAppRunnerDelegate::JSAppRunnerDelegate()
37 : ModuleRunnerDelegate(GetModuleSearchPaths()) { 38 : ModuleRunnerDelegate(GetModuleSearchPaths()) {
38 AddBuiltin<gin::Console>(this); 39 AddBuiltin<gin::Console>(this);
40 AddBuiltinModule(gin::TimerModule::kName, gin::TimerModule::GetModule);
39 AddBuiltin<mojo::js::Core>(this); 41 AddBuiltin<mojo::js::Core>(this);
40 AddBuiltin<mojo::js::Support>(this); 42 AddBuiltin<mojo::js::Support>(this);
41 AddBuiltin<mojo::js::Threading>(this); 43 AddBuiltin<mojo::js::Threading>(this);
42 AddBuiltin<gl::GL>(this); 44 AddBuiltin<gl::GL>(this);
43 AddBuiltin<MonotonicClock>(this); 45 AddBuiltin<MonotonicClock>(this);
44 } 46 }
45 47
46 JSAppRunnerDelegate::~JSAppRunnerDelegate() { 48 JSAppRunnerDelegate::~JSAppRunnerDelegate() {
47 } 49 }
48 50
49 void JSAppRunnerDelegate::UnhandledException(gin::ShellRunner* runner, 51 void JSAppRunnerDelegate::UnhandledException(gin::ShellRunner* runner,
50 gin::TryCatch& try_catch) { 52 gin::TryCatch& try_catch) {
51 gin::ModuleRunnerDelegate::UnhandledException(runner, try_catch); 53 gin::ModuleRunnerDelegate::UnhandledException(runner, try_catch);
52 LOG(ERROR) << try_catch.GetStackTrace(); 54 LOG(ERROR) << try_catch.GetStackTrace();
53 } 55 }
54 56
55 } // namespace js 57 } // namespace js
56 58
OLDNEW
« examples/js/cube.js ('K') | « examples/js/cube.js ('k') | services/js/modules/gl/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698