OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/shell/context.h" | 5 #include "mojo/shell/context.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 #if defined(OS_ANDROID) | 227 #if defined(OS_ANDROID) |
228 // On android, the network service is bundled with the shell because the | 228 // On android, the network service is bundled with the shell because the |
229 // network stack depends on the android runtime. | 229 // network stack depends on the android runtime. |
230 { | 230 { |
231 scoped_ptr<BackgroundShellApplicationLoader> loader( | 231 scoped_ptr<BackgroundShellApplicationLoader> loader( |
232 new BackgroundShellApplicationLoader( | 232 new BackgroundShellApplicationLoader( |
233 scoped_ptr<ApplicationLoader>(new NetworkApplicationLoader()), | 233 scoped_ptr<ApplicationLoader>(new NetworkApplicationLoader()), |
234 "network_service", | 234 "network_service", |
235 base::MessageLoop::TYPE_IO)); | 235 base::MessageLoop::TYPE_IO)); |
236 application_manager_.SetLoaderForURL(loader.PassAs<ApplicationLoader>(), | 236 application_manager_.SetLoaderForURL(loader.Pass(), |
237 GURL("mojo:mojo_network_service")); | 237 GURL("mojo:mojo_network_service")); |
238 } | 238 } |
239 #endif | 239 #endif |
240 | 240 |
241 if (listener_) | 241 if (listener_) |
242 listener_->WaitForListening(); | 242 listener_->WaitForListening(); |
243 } | 243 } |
244 | 244 |
245 void Context::OnApplicationError(const GURL& gurl) { | 245 void Context::OnApplicationError(const GURL& gurl) { |
246 if (app_urls_.find(gurl) != app_urls_.end()) { | 246 if (app_urls_.find(gurl) != app_urls_.end()) { |
(...skipping 15 matching lines...) Expand all Loading... |
262 ScopedMessagePipeHandle Context::ConnectToServiceByName( | 262 ScopedMessagePipeHandle Context::ConnectToServiceByName( |
263 const GURL& application_url, | 263 const GURL& application_url, |
264 const std::string& service_name) { | 264 const std::string& service_name) { |
265 app_urls_.insert(application_url); | 265 app_urls_.insert(application_url); |
266 return application_manager_.ConnectToServiceByName( | 266 return application_manager_.ConnectToServiceByName( |
267 application_url, service_name).Pass(); | 267 application_url, service_name).Pass(); |
268 } | 268 } |
269 | 269 |
270 } // namespace shell | 270 } // namespace shell |
271 } // namespace mojo | 271 } // namespace mojo |
OLD | NEW |