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_util.h" | 5 #include "base/files/file_util.h" |
6 #include "base/files/scoped_file.h" | 6 #include "base/files/scoped_file.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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #endif | 98 #endif |
99 CHECK(irt_url.is_valid()) << "Cannot resolve IRT URL"; | 99 CHECK(irt_url.is_valid()) << "Cannot resolve IRT URL"; |
100 | 100 |
101 irt_fp_ = TempFileForURL(url_loader, irt_url); | 101 irt_fp_ = TempFileForURL(url_loader, irt_url); |
102 CHECK(irt_fp_) << "Could not acquire the IRT"; | 102 CHECK(irt_fp_) << "Could not acquire the IRT"; |
103 } | 103 } |
104 | 104 |
105 // Overridden from ApplicationDelegate: | 105 // Overridden from ApplicationDelegate: |
106 bool ConfigureIncomingConnection( | 106 bool ConfigureIncomingConnection( |
107 mojo::ApplicationConnection* connection) override { | 107 mojo::ApplicationConnection* connection) override { |
108 connection->AddService(&content_handler_factory_); | 108 connection->GetServiceProviderImpl().AddService<mojo::ContentHandler>( |
| 109 content_handler_factory_.GetInterfaceRequestHandler()); |
109 return true; | 110 return true; |
110 } | 111 } |
111 | 112 |
112 // Overridden from ContentHandlerFactory::Delegate: | 113 // Overridden from ContentHandlerFactory::Delegate: |
113 void RunApplication( | 114 void RunApplication( |
114 mojo::InterfaceRequest<mojo::Application> application_request, | 115 mojo::InterfaceRequest<mojo::Application> application_request, |
115 mojo::URLResponsePtr response) override { | 116 mojo::URLResponsePtr response) override { |
116 // Needed to use Mojo interfaces on this thread. | 117 // Needed to use Mojo interfaces on this thread. |
117 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); | 118 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); |
118 | 119 |
(...skipping 29 matching lines...) Expand all Loading... |
148 }; | 149 }; |
149 | 150 |
150 } // namespace content_handler | 151 } // namespace content_handler |
151 } // namespace nacl | 152 } // namespace nacl |
152 | 153 |
153 MojoResult MojoMain(MojoHandle application_request) { | 154 MojoResult MojoMain(MojoHandle application_request) { |
154 mojo::ApplicationRunnerChromium runner( | 155 mojo::ApplicationRunnerChromium runner( |
155 new nacl::content_handler::NaClContentHandler()); | 156 new nacl::content_handler::NaClContentHandler()); |
156 return runner.Run(application_request); | 157 return runner.Run(application_request); |
157 } | 158 } |
OLD | NEW |