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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::ApplicationConnection* connection) override { |
241 bool strict = HasStrictQueryParam(connection->GetServiceProviderImpl() | 241 bool strict = HasStrictQueryParam(connection->GetServiceProviderImpl() |
242 .connection_context() | 242 .connection_context() |
243 .connection_url); | 243 .connection_url); |
244 if (default_strict_ || strict) { | 244 if (default_strict_ || strict) { |
245 connection->AddService(&strict_content_handler_factory_); | 245 connection->GetServiceProviderImpl().AddService<mojo::ContentHandler>( |
| 246 strict_content_handler_factory_.GetInterfaceRequestHandler()); |
246 } else { | 247 } else { |
247 connection->AddService(&content_handler_factory_); | 248 connection->GetServiceProviderImpl().AddService<mojo::ContentHandler>( |
| 249 content_handler_factory_.GetInterfaceRequestHandler()); |
248 } | 250 } |
249 return true; | 251 return true; |
250 } | 252 } |
251 | 253 |
252 mojo::TracingImpl tracing_; | 254 mojo::TracingImpl tracing_; |
253 DartContentHandler content_handler_; | 255 DartContentHandler content_handler_; |
254 DartContentHandler strict_content_handler_; | 256 DartContentHandler strict_content_handler_; |
255 mojo::ContentHandlerFactory content_handler_factory_; | 257 mojo::ContentHandlerFactory content_handler_factory_; |
256 mojo::ContentHandlerFactory strict_content_handler_factory_; | 258 mojo::ContentHandlerFactory strict_content_handler_factory_; |
257 mojo::URLResponseDiskCachePtr url_response_disk_cache_; | 259 mojo::URLResponseDiskCachePtr url_response_disk_cache_; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 pause_isolates_on_exit)); | 326 pause_isolates_on_exit)); |
325 } | 327 } |
326 } | 328 } |
327 | 329 |
328 } // namespace dart | 330 } // namespace dart |
329 | 331 |
330 MojoResult MojoMain(MojoHandle application_request) { | 332 MojoResult MojoMain(MojoHandle application_request) { |
331 mojo::ApplicationRunnerChromium runner(new dart::DartContentHandlerApp); | 333 mojo::ApplicationRunnerChromium runner(new dart::DartContentHandlerApp); |
332 return runner.Run(application_request); | 334 return runner.Run(application_request); |
333 } | 335 } |
OLD | NEW |