| 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 #include "services/dart/content_handler_app.h" | 4 #include "services/dart/content_handler_app.h" |
| 5 | 5 |
| 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" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 callback.Run(); | 125 callback.Run(); |
| 126 }); | 126 }); |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool DartContentHandlerApp::run_on_message_loop() const { | 129 bool DartContentHandlerApp::run_on_message_loop() const { |
| 130 return run_on_message_loop_; | 130 return run_on_message_loop_; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void DartContentHandlerApp::Initialize(mojo::ApplicationImpl* app) { | 133 void DartContentHandlerApp::Initialize(mojo::ApplicationImpl* app) { |
| 134 // Tracing of content handler and controller. | 134 // Tracing of content handler and controller. |
| 135 tracing_.Initialize(app); | 135 tracing_.Initialize(app->shell(), &app->args()); |
| 136 // Tracing of isolates and VM. | 136 // Tracing of isolates and VM. |
| 137 dart_tracing_.Initialize(app); | 137 dart_tracing_.Initialize(app->shell()); |
| 138 | 138 |
| 139 // TODO(qsr): This has no effect for now, as the tracing infrastructure | 139 // TODO(qsr): This has no effect for now, as the tracing infrastructure |
| 140 // doesn't allow to trace anything before the tracing app connects to the | 140 // doesn't allow to trace anything before the tracing app connects to the |
| 141 // application. | 141 // application. |
| 142 TRACE_EVENT0("dart_content_handler", "DartContentHandler::Initialize"); | 142 TRACE_EVENT0("dart_content_handler", "DartContentHandler::Initialize"); |
| 143 | 143 |
| 144 default_strict_ = app->HasArg(kEnableStrictMode); | 144 default_strict_ = app->HasArg(kEnableStrictMode); |
| 145 content_handler_.set_handler_task_runner( | 145 content_handler_.set_handler_task_runner( |
| 146 base::MessageLoop::current()->task_runner()); | 146 base::MessageLoop::current()->task_runner()); |
| 147 strict_content_handler_.set_handler_task_runner( | 147 strict_content_handler_.set_handler_task_runner( |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 } else { | 251 } else { |
| 252 // Loading a raw .dart file pointed at by |url|. | 252 // Loading a raw .dart file pointed at by |url|. |
| 253 return make_scoped_ptr( | 253 return make_scoped_ptr( |
| 254 new DartApp(application_request.Pass(), url, strict_, | 254 new DartApp(application_request.Pass(), url, strict_, |
| 255 run_on_message_loop, override_pause_isolates_flags, | 255 run_on_message_loop, override_pause_isolates_flags, |
| 256 pause_isolates_on_start, pause_isolates_on_exit)); | 256 pause_isolates_on_start, pause_isolates_on_exit)); |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 | 259 |
| 260 } // namespace dart | 260 } // namespace dart |
| OLD | NEW |