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 "mojo/application_manager/application_manager.h" | 5 #include "mojo/application_manager/application_manager.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 if (iter != url_to_content_handler_.end()) { | 252 if (iter != url_to_content_handler_.end()) { |
253 connection = iter->second; | 253 connection = iter->second; |
254 } else { | 254 } else { |
255 connection = new ContentHandlerConnection(this, content_handler_url); | 255 connection = new ContentHandlerConnection(this, content_handler_url); |
256 url_to_content_handler_[content_handler_url] = connection; | 256 url_to_content_handler_[content_handler_url] = connection; |
257 } | 257 } |
258 | 258 |
259 InterfaceRequest<ServiceProvider> spir; | 259 InterfaceRequest<ServiceProvider> spir; |
260 spir.Bind(service_provider.PassMessagePipe()); | 260 spir.Bind(service_provider.PassMessagePipe()); |
261 connection->content_handler->OnConnect( | 261 connection->content_handler->OnConnect( |
262 content_url.spec(), url_response.Pass(), spir.Pass()); | 262 requestor_url.spec(), url_response.Pass(), spir.Pass()); |
263 } | 263 } |
264 | 264 |
265 void ApplicationManager::SetLoaderForURL(scoped_ptr<ApplicationLoader> loader, | 265 void ApplicationManager::SetLoaderForURL(scoped_ptr<ApplicationLoader> loader, |
266 const GURL& url) { | 266 const GURL& url) { |
267 URLToLoaderMap::iterator it = url_to_loader_.find(url); | 267 URLToLoaderMap::iterator it = url_to_loader_.find(url); |
268 if (it != url_to_loader_.end()) | 268 if (it != url_to_loader_.end()) |
269 delete it->second; | 269 delete it->second; |
270 url_to_loader_[url] = loader.release(); | 270 url_to_loader_[url] = loader.release(); |
271 } | 271 } |
272 | 272 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 StubServiceProvider* stub_sp = new StubServiceProvider; | 319 StubServiceProvider* stub_sp = new StubServiceProvider; |
320 ServiceProviderPtr spp; | 320 ServiceProviderPtr spp; |
321 BindToProxy(stub_sp, &spp); | 321 BindToProxy(stub_sp, &spp); |
322 ConnectToApplication(application_url, GURL(), spp.Pass()); | 322 ConnectToApplication(application_url, GURL(), spp.Pass()); |
323 MessagePipe pipe; | 323 MessagePipe pipe; |
324 stub_sp->GetRemoteServiceProvider()->ConnectToService(interface_name, | 324 stub_sp->GetRemoteServiceProvider()->ConnectToService(interface_name, |
325 pipe.handle1.Pass()); | 325 pipe.handle1.Pass()); |
326 return pipe.handle0.Pass(); | 326 return pipe.handle0.Pass(); |
327 } | 327 } |
328 } // namespace mojo | 328 } // namespace mojo |
OLD | NEW |