| OLD | NEW |
| 1 // Copyright 2014 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
| 11 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
| 12 #include "mojo/application/application_runner_chromium.h" | 12 #include "mojo/application/application_runner_chromium.h" |
| 13 #include "mojo/application/content_handler_factory.h" | 13 #include "mojo/application/content_handler_factory.h" |
| 14 #include "mojo/common/tracing_impl.h" | 14 #include "mojo/common/tracing_impl.h" |
| 15 #include "mojo/dart/embedder/dart_controller.h" | 15 #include "mojo/dart/embedder/dart_controller.h" |
| 16 #include "mojo/public/c/system/main.h" | 16 #include "mojo/public/c/system/main.h" |
| 17 #include "mojo/public/cpp/application/application_delegate.h" | 17 #include "mojo/public/cpp/application/application_delegate.h" |
| 18 #include "mojo/public/cpp/application/application_impl.h" | 18 #include "mojo/public/cpp/application/application_impl.h" |
| 19 #include "mojo/public/cpp/application/connect.h" |
| 19 #include "mojo/public/cpp/bindings/binding.h" | 20 #include "mojo/public/cpp/bindings/binding.h" |
| 20 #include "mojo/public/cpp/bindings/interface_request.h" | 21 #include "mojo/public/cpp/bindings/interface_request.h" |
| 21 #include "mojo/services/tracing/interfaces/tracing.mojom.h" | 22 #include "mojo/services/tracing/interfaces/tracing.mojom.h" |
| 22 #include "mojo/services/url_response_disk_cache/interfaces/url_response_disk_cac
he.mojom.h" | 23 #include "mojo/services/url_response_disk_cache/interfaces/url_response_disk_cac
he.mojom.h" |
| 23 #include "services/dart/content_handler_app_service_connector.h" | 24 #include "services/dart/content_handler_app_service_connector.h" |
| 24 #include "services/dart/dart_app.h" | 25 #include "services/dart/dart_app.h" |
| 25 #include "services/dart/dart_tracing.h" | 26 #include "services/dart/dart_tracing.h" |
| 26 #include "url/gurl.h" | 27 #include "url/gurl.h" |
| 27 | 28 |
| 28 namespace dart { | 29 namespace dart { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // TODO(qsr): This has no effect for now, as the tracing infrastructure | 180 // TODO(qsr): This has no effect for now, as the tracing infrastructure |
| 180 // doesn't allow to trace anything before the tracing app connects to the | 181 // doesn't allow to trace anything before the tracing app connects to the |
| 181 // application. | 182 // application. |
| 182 TRACE_EVENT0("dart_content_handler", "DartContentHandler::Initialize"); | 183 TRACE_EVENT0("dart_content_handler", "DartContentHandler::Initialize"); |
| 183 | 184 |
| 184 default_strict_ = app->HasArg(kEnableStrictMode); | 185 default_strict_ = app->HasArg(kEnableStrictMode); |
| 185 content_handler_.set_handler_task_runner( | 186 content_handler_.set_handler_task_runner( |
| 186 base::MessageLoop::current()->task_runner()); | 187 base::MessageLoop::current()->task_runner()); |
| 187 strict_content_handler_.set_handler_task_runner( | 188 strict_content_handler_.set_handler_task_runner( |
| 188 base::MessageLoop::current()->task_runner()); | 189 base::MessageLoop::current()->task_runner()); |
| 189 app->ConnectToServiceDeprecated("mojo:url_response_disk_cache", | 190 mojo::ConnectToService(app->shell(), "mojo:url_response_disk_cache", |
| 190 &url_response_disk_cache_); | 191 GetProxy(&url_response_disk_cache_)); |
| 191 service_connector_ = new ContentHandlerAppServiceConnector(app); | 192 service_connector_ = new ContentHandlerAppServiceConnector(app); |
| 192 | 193 |
| 193 if (app->HasArg(kRunOnMessageLoop)) { | 194 if (app->HasArg(kRunOnMessageLoop)) { |
| 194 run_on_message_loop_ = true; | 195 run_on_message_loop_ = true; |
| 195 } | 196 } |
| 196 | 197 |
| 197 bool enable_observatory = true; | 198 bool enable_observatory = true; |
| 198 if (app->HasArg(kDisableObservatory)) { | 199 if (app->HasArg(kDisableObservatory)) { |
| 199 enable_observatory = false; | 200 enable_observatory = false; |
| 200 } | 201 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 pause_isolates_on_exit)); | 322 pause_isolates_on_exit)); |
| 322 } | 323 } |
| 323 } | 324 } |
| 324 | 325 |
| 325 } // namespace dart | 326 } // namespace dart |
| 326 | 327 |
| 327 MojoResult MojoMain(MojoHandle application_request) { | 328 MojoResult MojoMain(MojoHandle application_request) { |
| 328 mojo::ApplicationRunnerChromium runner(new dart::DartContentHandlerApp); | 329 mojo::ApplicationRunnerChromium runner(new dart::DartContentHandlerApp); |
| 329 return runner.Run(application_request); | 330 return runner.Run(application_request); |
| 330 } | 331 } |
| OLD | NEW |