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_application_loader.h" | 5 #include "mojo/shell/network_application_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 13 matching lines...) Expand all Loading... |
24 namespace shell { | 24 namespace shell { |
25 | 25 |
26 NetworkApplicationLoader::NetworkApplicationLoader() { | 26 NetworkApplicationLoader::NetworkApplicationLoader() { |
27 } | 27 } |
28 | 28 |
29 NetworkApplicationLoader::~NetworkApplicationLoader() { | 29 NetworkApplicationLoader::~NetworkApplicationLoader() { |
30 } | 30 } |
31 | 31 |
32 void NetworkApplicationLoader::Load(ApplicationManager* manager, | 32 void NetworkApplicationLoader::Load(ApplicationManager* manager, |
33 const GURL& url, | 33 const GURL& url, |
34 scoped_refptr<LoadCallbacks> callbacks) { | 34 ScopedMessagePipeHandle shell_handle, |
35 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); | 35 LoadCallback callback) { |
36 if (!shell_handle.is_valid()) | 36 DCHECK(shell_handle.is_valid()); |
37 return; | |
38 | |
39 uintptr_t key = reinterpret_cast<uintptr_t>(manager); | 37 uintptr_t key = reinterpret_cast<uintptr_t>(manager); |
40 if (apps_.find(key) == apps_.end()) { | 38 if (apps_.find(key) == apps_.end()) { |
41 scoped_ptr<ApplicationImpl> app( | 39 scoped_ptr<ApplicationImpl> app( |
42 new ApplicationImpl(this, shell_handle.Pass())); | 40 new ApplicationImpl(this, shell_handle.Pass())); |
43 apps_.add(key, app.Pass()); | 41 apps_.add(key, app.Pass()); |
44 } | 42 } |
45 } | 43 } |
46 | 44 |
47 void NetworkApplicationLoader::OnApplicationError(ApplicationManager* manager, | 45 void NetworkApplicationLoader::OnApplicationError(ApplicationManager* manager, |
48 const GURL& url) { | 46 const GURL& url) { |
(...skipping 12 matching lines...) Expand all Loading... |
61 } | 59 } |
62 | 60 |
63 void NetworkApplicationLoader::Create( | 61 void NetworkApplicationLoader::Create( |
64 ApplicationConnection* connection, | 62 ApplicationConnection* connection, |
65 InterfaceRequest<NetworkService> request) { | 63 InterfaceRequest<NetworkService> request) { |
66 BindToRequest(new NetworkServiceImpl(connection, context_.get()), &request); | 64 BindToRequest(new NetworkServiceImpl(connection, context_.get()), &request); |
67 } | 65 } |
68 | 66 |
69 } // namespace shell | 67 } // namespace shell |
70 } // namespace mojo | 68 } // namespace mojo |
OLD | NEW |