| Index: mojo/apps/js/content_handler_main.cc
|
| diff --git a/mojo/apps/js/content_handler_main.cc b/mojo/apps/js/content_handler_main.cc
|
| index 6c6a0a8414c6eebf87c5253876f4549ee69859a8..ab3df22c0973c7a5701d1df7c22a1a0959dcf9fc 100644
|
| --- a/mojo/apps/js/content_handler_main.cc
|
| +++ b/mojo/apps/js/content_handler_main.cc
|
| @@ -4,42 +4,36 @@
|
|
|
|
|
| #include "base/i18n/icu_util.h"
|
| -#include "mojo/application/application_runner_chromium.h"
|
| -#include "mojo/apps/js/application_delegate_impl.h"
|
| -#include "mojo/apps/js/content_handler_impl.h"
|
| +#include "gin/array_buffer.h"
|
| +#include "gin/public/isolate_holder.h"
|
| +#include "mojo/application/content_handler.h"
|
| +#include "mojo/apps/js/js_app.h"
|
| #include "mojo/public/c/system/main.h"
|
| #include "mojo/public/cpp/application/application_impl.h"
|
| #include "mojo/public/cpp/application/interface_factory_impl.h"
|
| -#include "mojo/services/public/interfaces/content_handler/content_handler.mojom.h"
|
|
|
| namespace mojo {
|
| namespace apps {
|
|
|
| -class ContentHandlerApplicationDelegateImpl : public ApplicationDelegateImpl {
|
| - public:
|
| - ContentHandlerApplicationDelegateImpl() : content_handler_factory_(this) {
|
| - }
|
| -
|
| +class JsContentHandler : public ContentHandlerDelegate {
|
| private:
|
| + // From ContentHandlerDelegate:
|
| void Initialize(ApplicationImpl* app) override {
|
| base::i18n::InitializeICU();
|
| - ApplicationDelegateImpl::Initialize(app);
|
| + gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
|
| + gin::ArrayBufferAllocator::SharedInstance());
|
| }
|
| -
|
| - bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
|
| - connection->AddService(&content_handler_factory_);
|
| - return true;
|
| + virtual scoped_ptr<mojo::InterfaceImpl<mojo::Application>> CreateApplication(
|
| + ShellPtr shell,
|
| + URLResponsePtr response) override {
|
| + return make_scoped_ptr(new JSApp(shell.Pass(), response.Pass()));
|
| }
|
| -
|
| - InterfaceFactoryImplWithContext<ContentHandlerImpl, ApplicationDelegateImpl>
|
| - content_handler_factory_;
|
| };
|
|
|
| } // namespace apps
|
| } // namespace mojo
|
|
|
| MojoResult MojoMain(MojoHandle shell_handle) {
|
| - mojo::ApplicationRunnerChromium runner(
|
| - new mojo::apps::ContentHandlerApplicationDelegateImpl());
|
| - return runner.Run(shell_handle);
|
| + return mojo::ContentHandlerRunner::Run(
|
| + shell_handle, make_scoped_ptr(new mojo::apps::JsContentHandler));
|
| }
|
|
|