| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "mojo/application/application_runner_chromium.h" | 9 #include "mojo/application/application_runner_chromium.h" |
| 10 #include "mojo/application/content_handler_factory.h" | 10 #include "mojo/application/content_handler_factory.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 LOG(FATAL) << "Cannot resolve IRT URL"; | 109 LOG(FATAL) << "Cannot resolve IRT URL"; |
| 110 } | 110 } |
| 111 | 111 |
| 112 if (!TempFileForURL(url_loader, irt_url, &irt_path_)) { | 112 if (!TempFileForURL(url_loader, irt_url, &irt_path_)) { |
| 113 LOG(FATAL) << "Could not aquire the IRT"; | 113 LOG(FATAL) << "Could not aquire the IRT"; |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 // Overridden from ApplicationDelegate: | 117 // Overridden from ApplicationDelegate: |
| 118 bool ConfigureIncomingConnection( | 118 bool ConfigureIncomingConnection( |
| 119 mojo::ApplicationConnection* connection) override { | 119 mojo::ApplicationConnection* connection, |
| 120 const std::string& url) override { |
| 120 connection->AddService(&content_handler_factory_); | 121 connection->AddService(&content_handler_factory_); |
| 121 return true; | 122 return true; |
| 122 } | 123 } |
| 123 | 124 |
| 124 // Overridden from ContentHandlerFactory::ManagedDelegate: | 125 // Overridden from ContentHandlerFactory::ManagedDelegate: |
| 125 void RunApplication( | 126 void RunApplication( |
| 126 mojo::InterfaceRequest<mojo::Application> application_request, | 127 mojo::InterfaceRequest<mojo::Application> application_request, |
| 127 mojo::URLResponsePtr response) override { | 128 mojo::URLResponsePtr response) override { |
| 128 // Needed to use Mojo interfaces on this thread. | 129 // Needed to use Mojo interfaces on this thread. |
| 129 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); | 130 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 }; | 173 }; |
| 173 | 174 |
| 174 } // namespace content_handler | 175 } // namespace content_handler |
| 175 } // namespace nacl | 176 } // namespace nacl |
| 176 | 177 |
| 177 MojoResult MojoMain(MojoHandle shell_handle) { | 178 MojoResult MojoMain(MojoHandle shell_handle) { |
| 178 mojo::ApplicationRunnerChromium runner( | 179 mojo::ApplicationRunnerChromium runner( |
| 179 new nacl::content_handler::NaClContentHandler()); | 180 new nacl::content_handler::NaClContentHandler()); |
| 180 return runner.Run(shell_handle); | 181 return runner.Run(shell_handle); |
| 181 } | 182 } |
| OLD | NEW |