| Index: mojo/apps/js/main.cc
|
| diff --git a/mojo/apps/js/main.cc b/mojo/apps/js/main.cc
|
| index 0eda50be6cce2bcfd2c143f3cebacb04f35313f4..73b9d6a61afc3e4df1e86d9259bc067822329d0b 100644
|
| --- a/mojo/apps/js/main.cc
|
| +++ b/mojo/apps/js/main.cc
|
| @@ -1,44 +1,15 @@
|
| -// 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/array_buffer.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/application_delegate_impl.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::Initialize(gin::IsolateHolder::kStrictMode,
|
| - gin::ArrayBufferAllocator::SharedInstance());
|
| - gin::IsolateHolder instance;
|
| - MojoRunnerDelegate delegate;
|
| - gin::ShellRunner runner(&delegate, instance.isolate());
|
| - delegate.Start(&runner, pipe, module);
|
| -
|
| - base::MessageLoop::current()->Run();
|
| -}
|
| -
|
| -} // 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;
|
| +MojoResult MojoMain(MojoHandle shell_handle) {
|
| + base::i18n::InitializeICU();
|
| + mojo::ApplicationRunnerChromium runner(
|
| + new mojo::apps::ApplicationDelegateImpl());
|
| + return runner.Run(shell_handle);
|
| }
|
|
|