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

Unified Diff: services/dart/content_handler_main.cc

Issue 816113004: Dart: Adds a content handler and a test. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: comment Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: services/dart/content_handler_main.cc
diff --git a/services/js/content_handler_main.cc b/services/dart/content_handler_main.cc
similarity index 57%
copy from services/js/content_handler_main.cc
copy to services/dart/content_handler_main.cc
index fb22a27669372e43fe78bf548636ff707fe61e78..bfee19b6bfe4fbf1c3a9cc2389be98de3f09806a 100644
--- a/services/js/content_handler_main.cc
+++ b/services/dart/content_handler_main.cc
@@ -2,31 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/i18n/icu_util.h"
-#include "gin/array_buffer.h"
-#include "gin/public/isolate_holder.h"
#include "mojo/application/application_runner_chromium.h"
#include "mojo/application/content_handler_factory.h"
+#include "mojo/icu/icu.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
-#include "services/js/js_app.h"
+#include "services/dart/dart_app.h"
-namespace js {
+namespace dart {
-class JsContentHandler : public mojo::ApplicationDelegate,
- public mojo::ContentHandlerFactory::ManagedDelegate {
+class DartContentHandler : public mojo::ApplicationDelegate,
+ public mojo::ContentHandlerFactory::ManagedDelegate {
public:
- JsContentHandler() : content_handler_factory_(this) {}
+ DartContentHandler() : content_handler_factory_(this) {}
private:
// Overridden from mojo::ApplicationDelegate:
void Initialize(mojo::ApplicationImpl* app) override {
- static const char v8Flags[] = "--harmony-classes";
- v8::V8::SetFlagsFromString(v8Flags, sizeof(v8Flags) - 1);
- base::i18n::InitializeICU();
- gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
- gin::ArrayBufferAllocator::SharedInstance());
+ mojo::icu::Initialize(app);
}
// Overridden from ApplicationDelegate:
@@ -40,17 +34,17 @@ class JsContentHandler : public mojo::ApplicationDelegate,
scoped_ptr<mojo::ContentHandlerFactory::HandledApplicationHolder>
CreateApplication(mojo::ShellPtr shell,
mojo::URLResponsePtr response) override {
- return make_scoped_ptr(new JSApp(shell.Pass(), response.Pass()));
+ return make_scoped_ptr(new DartApp(shell.Pass(), response.Pass()));
}
mojo::ContentHandlerFactory content_handler_factory_;
- DISALLOW_COPY_AND_ASSIGN(JsContentHandler);
+ DISALLOW_COPY_AND_ASSIGN(DartContentHandler);
};
-} // namespace js
+} // namespace dart
MojoResult MojoMain(MojoHandle shell_handle) {
- mojo::ApplicationRunnerChromium runner(new js::JsContentHandler);
+ mojo::ApplicationRunnerChromium runner(new dart::DartContentHandler);
return runner.Run(shell_handle);
}

Powered by Google App Engine
This is Rietveld 408576698