Index: mojo/apps/js/main.cc |
diff --git a/mojo/apps/js/main.cc b/mojo/apps/js/main.cc |
index b5d4486736d60b2666b176880310c3922d8e8146..4282ae263541ec42d5cdaaf0e0da491ddfa56adb 100644 |
--- a/mojo/apps/js/main.cc |
+++ b/mojo/apps/js/main.cc |
@@ -1,41 +1,16 @@ |
-// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "base/message_loop/message_loop.h" |
-#include "gin/public/isolate_holder.h" |
-#include "mojo/apps/js/mojo_runner_delegate.h" |
-#include "mojo/public/cpp/system/core.h" |
-#include "mojo/public/cpp/system/macros.h" |
+#include "base/i18n/icu_util.h" |
+#include "mojo/apps/js/js_content_handler_app.h" |
+#include "mojo/public/c/system/main.h" |
+#include "mojo/public/cpp/application/application_runner_chromium.h" |
-#if defined(WIN32) |
-#if !defined(CDECL) |
-#define CDECL __cdecl |
-#endif |
-#define MOJO_APPS_JS_EXPORT __declspec(dllexport) |
-#else |
-#define CDECL |
-#define MOJO_APPS_JS_EXPORT __attribute__((visibility("default"))) |
-#endif |
-namespace mojo { |
-namespace apps { |
- |
-void Start(MojoHandle pipe, const std::string& module) { |
- base::MessageLoop loop; |
- |
- gin::IsolateHolder instance(gin::IsolateHolder::kStrictMode); |
- MojoRunnerDelegate delegate; |
- gin::ShellRunner runner(&delegate, instance.isolate()); |
- delegate.Start(&runner, pipe, module); |
- |
- base::MessageLoop::current()->Run(); |
+MojoResult MojoMain(MojoHandle shell_handle) { |
+ base::i18n::InitializeICU(); |
+ mojo::ApplicationRunnerChromium runner(new mojo::apps::JSContentHandlerApp()); |
+ return runner.Run(shell_handle); |
} |
-} // namespace apps |
-} // namespace mojo |
- |
-extern "C" MOJO_APPS_JS_EXPORT MojoResult CDECL MojoMain(MojoHandle pipe) { |
- mojo::apps::Start(pipe, "mojo/apps/js/main"); |
- return MOJO_RESULT_OK; |
-} |