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

Side by Side Diff: mojo/apps/js/main.cc

Issue 467263006: JavaScript Content Handler Version 0.0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 months 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
OLDNEW
1 // Copyright 2013 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 "base/message_loop/message_loop.h" 5 #include "base/i18n/icu_util.h"
6 #include "gin/array_buffer.h" 6 #include "mojo/apps/js/application_delegate_impl.h"
7 #include "gin/public/isolate_holder.h" 7 #include "mojo/public/c/system/main.h"
8 #include "mojo/apps/js/mojo_runner_delegate.h" 8 #include "mojo/public/cpp/application/application_runner_chromium.h"
9 #include "mojo/public/cpp/system/core.h"
10 #include "mojo/public/cpp/system/macros.h"
11 9
12 #if defined(WIN32) 10 MojoResult MojoMain(MojoHandle shell_handle) {
13 #if !defined(CDECL) 11 base::i18n::InitializeICU();
14 #define CDECL __cdecl 12 mojo::ApplicationRunnerChromium runner(
15 #endif 13 new mojo::apps::ApplicationDelegateImpl());
16 #define MOJO_APPS_JS_EXPORT __declspec(dllexport) 14 return runner.Run(shell_handle);
17 #else
18 #define CDECL
19 #define MOJO_APPS_JS_EXPORT __attribute__((visibility("default")))
20 #endif
21
22 namespace mojo {
23 namespace apps {
24
25 void Start(MojoHandle pipe, const std::string& module) {
26 base::MessageLoop loop;
27
28 gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
29 gin::ArrayBufferAllocator::SharedInstance());
30 gin::IsolateHolder instance;
31 MojoRunnerDelegate delegate;
32 gin::ShellRunner runner(&delegate, instance.isolate());
33 delegate.Start(&runner, pipe, module);
34
35 base::MessageLoop::current()->Run();
36 } 15 }
37
38 } // namespace apps
39 } // namespace mojo
40
41 extern "C" MOJO_APPS_JS_EXPORT MojoResult CDECL MojoMain(MojoHandle pipe) {
42 mojo::apps::Start(pipe, "mojo/apps/js/main");
43 return MOJO_RESULT_OK;
44 }
OLDNEW
« mojo/apps/js/js_app.cc ('K') | « mojo/apps/js/js_app.cc ('k') | mojo/apps/js/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698