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/strings/string_util.h" | 5 #include "base/strings/string_util.h" |
6 #include "mojo/application/application_runner_chromium.h" | 6 #include "mojo/application/application_runner_chromium.h" |
7 #include "mojo/application/content_handler_factory.h" | 7 #include "mojo/application/content_handler_factory.h" |
8 #include "mojo/dart/embedder/dart_controller.h" | 8 #include "mojo/dart/embedder/dart_controller.h" |
9 #include "mojo/icu/icu.h" | 9 #include "mojo/icu/icu.h" |
10 #include "mojo/public/c/system/main.h" | 10 #include "mojo/public/c/system/main.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 } | 40 } |
41 | 41 |
42 bool success = mojo::dart::DartController::Initialize(strict_compilation); | 42 bool success = mojo::dart::DartController::Initialize(strict_compilation); |
43 if (!success) { | 43 if (!success) { |
44 LOG(ERROR) << "Dart VM Initialization failed"; | 44 LOG(ERROR) << "Dart VM Initialization failed"; |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 // Overridden from ApplicationDelegate: | 48 // Overridden from ApplicationDelegate: |
49 bool ConfigureIncomingConnection( | 49 bool ConfigureIncomingConnection( |
50 mojo::ApplicationConnection* connection) override { | 50 mojo::ApplicationConnection* connection, |
| 51 const std::string& url) override { |
51 connection->AddService(&content_handler_factory_); | 52 connection->AddService(&content_handler_factory_); |
52 return true; | 53 return true; |
53 } | 54 } |
54 | 55 |
55 // Overridden from ContentHandlerFactory::ManagedDelegate: | 56 // Overridden from ContentHandlerFactory::ManagedDelegate: |
56 scoped_ptr<mojo::ContentHandlerFactory::HandledApplicationHolder> | 57 scoped_ptr<mojo::ContentHandlerFactory::HandledApplicationHolder> |
57 CreateApplication( | 58 CreateApplication( |
58 mojo::InterfaceRequest<mojo::Application> application_request, | 59 mojo::InterfaceRequest<mojo::Application> application_request, |
59 mojo::URLResponsePtr response) override { | 60 mojo::URLResponsePtr response) override { |
60 return make_scoped_ptr( | 61 return make_scoped_ptr( |
61 new DartApp(application_request.Pass(), response.Pass())); | 62 new DartApp(application_request.Pass(), response.Pass())); |
62 } | 63 } |
63 | 64 |
64 mojo::ContentHandlerFactory content_handler_factory_; | 65 mojo::ContentHandlerFactory content_handler_factory_; |
65 | 66 |
66 DISALLOW_COPY_AND_ASSIGN(DartContentHandler); | 67 DISALLOW_COPY_AND_ASSIGN(DartContentHandler); |
67 }; | 68 }; |
68 | 69 |
69 } // namespace dart | 70 } // namespace dart |
70 | 71 |
71 MojoResult MojoMain(MojoHandle shell_handle) { | 72 MojoResult MojoMain(MojoHandle shell_handle) { |
72 mojo::ApplicationRunnerChromium runner(new dart::DartContentHandler); | 73 mojo::ApplicationRunnerChromium runner(new dart::DartContentHandler); |
73 return runner.Run(shell_handle); | 74 return runner.Run(shell_handle); |
74 } | 75 } |
OLD | NEW |