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" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 if (app->HasArg(kTraceStartup)) { | 230 if (app->HasArg(kTraceStartup)) { |
231 DartTimelineController::EnableAll(); | 231 DartTimelineController::EnableAll(); |
232 } | 232 } |
233 if (!success) { | 233 if (!success) { |
234 LOG(ERROR) << "Dart VM Initialization failed"; | 234 LOG(ERROR) << "Dart VM Initialization failed"; |
235 } | 235 } |
236 } | 236 } |
237 | 237 |
238 // Overridden from ApplicationDelegate: | 238 // Overridden from ApplicationDelegate: |
239 bool ConfigureIncomingConnection( | 239 bool ConfigureIncomingConnection( |
240 mojo::ApplicationConnection* connection) override { | 240 mojo::ServiceProviderImpl* service_provider_impl) override { |
241 bool strict = HasStrictQueryParam(connection->GetServiceProviderImpl() | 241 bool strict = HasStrictQueryParam( |
242 .connection_context() | 242 service_provider_impl->connection_context().connection_url); |
243 .connection_url); | |
244 if (default_strict_ || strict) { | 243 if (default_strict_ || strict) { |
245 connection->GetServiceProviderImpl().AddService<mojo::ContentHandler>( | 244 service_provider_impl->AddService<mojo::ContentHandler>( |
246 strict_content_handler_factory_.GetInterfaceRequestHandler()); | 245 strict_content_handler_factory_.GetInterfaceRequestHandler()); |
247 } else { | 246 } else { |
248 connection->GetServiceProviderImpl().AddService<mojo::ContentHandler>( | 247 service_provider_impl->AddService<mojo::ContentHandler>( |
249 content_handler_factory_.GetInterfaceRequestHandler()); | 248 content_handler_factory_.GetInterfaceRequestHandler()); |
250 } | 249 } |
251 return true; | 250 return true; |
252 } | 251 } |
253 | 252 |
254 mojo::TracingImpl tracing_; | 253 mojo::TracingImpl tracing_; |
255 DartContentHandler content_handler_; | 254 DartContentHandler content_handler_; |
256 DartContentHandler strict_content_handler_; | 255 DartContentHandler strict_content_handler_; |
257 mojo::ContentHandlerFactory content_handler_factory_; | 256 mojo::ContentHandlerFactory content_handler_factory_; |
258 mojo::ContentHandlerFactory strict_content_handler_factory_; | 257 mojo::ContentHandlerFactory strict_content_handler_factory_; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 pause_isolates_on_exit)); | 325 pause_isolates_on_exit)); |
327 } | 326 } |
328 } | 327 } |
329 | 328 |
330 } // namespace dart | 329 } // namespace dart |
331 | 330 |
332 MojoResult MojoMain(MojoHandle application_request) { | 331 MojoResult MojoMain(MojoHandle application_request) { |
333 mojo::ApplicationRunnerChromium runner(new dart::DartContentHandlerApp); | 332 mojo::ApplicationRunnerChromium runner(new dart::DartContentHandlerApp); |
334 return runner.Run(application_request); | 333 return runner.Run(application_request); |
335 } | 334 } |
OLD | NEW |