| 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/shell/network_service_loader.h" | 5 #include "mojo/shell/network_service_loader.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 NetworkServiceLoader::NetworkServiceLoader() { | 26 NetworkServiceLoader::NetworkServiceLoader() { |
| 27 } | 27 } |
| 28 | 28 |
| 29 NetworkServiceLoader::~NetworkServiceLoader() { | 29 NetworkServiceLoader::~NetworkServiceLoader() { |
| 30 } | 30 } |
| 31 | 31 |
| 32 void NetworkServiceLoader::LoadService( | 32 void NetworkServiceLoader::LoadService( |
| 33 ServiceManager* manager, | 33 ServiceManager* manager, |
| 34 const GURL& url, | 34 const GURL& url, |
| 35 ScopedMessagePipeHandle shell_handle) { | 35 scoped_refptr<LoadServiceCallbacks> callbacks) { |
| 36 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); |
| 37 if (!shell_handle.is_valid()) |
| 38 return; |
| 39 |
| 36 uintptr_t key = reinterpret_cast<uintptr_t>(manager); | 40 uintptr_t key = reinterpret_cast<uintptr_t>(manager); |
| 37 if (apps_.find(key) == apps_.end()) { | 41 if (apps_.find(key) == apps_.end()) { |
| 38 scoped_ptr<ApplicationImpl> app( | 42 scoped_ptr<ApplicationImpl> app( |
| 39 new ApplicationImpl(this, shell_handle.Pass())); | 43 new ApplicationImpl(this, shell_handle.Pass())); |
| 40 apps_.add(key, app.Pass()); | 44 apps_.add(key, app.Pass()); |
| 41 } | 45 } |
| 42 } | 46 } |
| 43 | 47 |
| 44 void NetworkServiceLoader::OnServiceError(ServiceManager* manager, | 48 void NetworkServiceLoader::OnServiceError(ServiceManager* manager, |
| 45 const GURL& url) { | 49 const GURL& url) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 57 return true; | 61 return true; |
| 58 } | 62 } |
| 59 | 63 |
| 60 void NetworkServiceLoader::Create(ApplicationConnection* connection, | 64 void NetworkServiceLoader::Create(ApplicationConnection* connection, |
| 61 InterfaceRequest<NetworkService> request) { | 65 InterfaceRequest<NetworkService> request) { |
| 62 BindToRequest(new NetworkServiceImpl(connection, context_.get()), &request); | 66 BindToRequest(new NetworkServiceImpl(connection, context_.get()), &request); |
| 63 } | 67 } |
| 64 | 68 |
| 65 } // namespace shell | 69 } // namespace shell |
| 66 } // namespace mojo | 70 } // namespace mojo |
| OLD | NEW |