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 "mojo/shell/package_manager/package_manager_impl.h" | 5 #include "mojo/shell/package_manager/package_manager_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 if (url.SchemeIs(url::kDataScheme)) { | 143 if (url.SchemeIs(url::kDataScheme)) { |
144 DataFetcher::Start(url, loader_callback); | 144 DataFetcher::Start(url, loader_callback); |
145 return; | 145 return; |
146 } | 146 } |
147 | 147 |
148 GURL resolved_url = ResolveURL(url); | 148 GURL resolved_url = ResolveURL(url); |
149 if (resolved_url.SchemeIsFile()) { | 149 if (resolved_url.SchemeIsFile()) { |
150 // LocalFetcher uses the network service to infer MIME types from URLs. | 150 // LocalFetcher uses the network service to infer MIME types from URLs. |
151 // Skip this for mojo URLs to avoid recursively loading the network service. | 151 // Skip this for mojo URLs to avoid recursively loading the network service. |
152 if (!network_service_ && !url.SchemeIs("mojo") && !url.SchemeIs("exe")) { | 152 if (!network_service_ && !url.SchemeIs("mojo") && !url.SchemeIs("exe")) { |
153 ConnectToService(application_manager_, GURL("mojo:network_service"), | 153 ConnectToInterface(application_manager_, GURL("mojo:network_service"), |
154 &network_service_); | 154 &network_service_); |
155 } | 155 } |
156 // Ownership of this object is transferred to |loader_callback|. | 156 // Ownership of this object is transferred to |loader_callback|. |
157 // TODO(beng): this is eff'n weird. | 157 // TODO(beng): this is eff'n weird. |
158 new LocalFetcher(network_service_.get(), resolved_url, | 158 new LocalFetcher(network_service_.get(), resolved_url, |
159 GetBaseURLAndQuery(resolved_url, nullptr), | 159 GetBaseURLAndQuery(resolved_url, nullptr), |
160 shell_file_root_, loader_callback); | 160 shell_file_root_, loader_callback); |
161 | 161 |
162 // TODO(beng): Determine if this is in the right place, and block | 162 // TODO(beng): Determine if this is in the right place, and block |
163 // establishing the connection on receiving a complete manifest. | 163 // establishing the connection on receiving a complete manifest. |
164 EnsureURLInCatalog(url); | 164 EnsureURLInCatalog(url); |
165 return; | 165 return; |
166 } | 166 } |
167 | 167 |
168 if (!url_loader_factory_) { | 168 if (!url_loader_factory_) { |
169 ConnectToService(application_manager_, GURL("mojo:network_service"), | 169 ConnectToInterface(application_manager_, GURL("mojo:network_service"), |
170 &url_loader_factory_); | 170 &url_loader_factory_); |
171 } | 171 } |
172 | 172 |
173 // Ownership of this object is transferred to |loader_callback|. | 173 // Ownership of this object is transferred to |loader_callback|. |
174 // TODO(beng): this is eff'n weird. | 174 // TODO(beng): this is eff'n weird. |
175 new NetworkFetcher(disable_cache_, std::move(request), | 175 new NetworkFetcher(disable_cache_, std::move(request), |
176 url_loader_factory_.get(), loader_callback); | 176 url_loader_factory_.get(), loader_callback); |
177 } | 177 } |
178 | 178 |
179 uint32_t PackageManagerImpl::HandleWithContentHandler( | 179 uint32_t PackageManagerImpl::HandleWithContentHandler( |
180 Fetcher* fetcher, | 180 Fetcher* fetcher, |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 return; | 381 return; |
382 | 382 |
383 base::DictionaryValue* dictionary = nullptr; | 383 base::DictionaryValue* dictionary = nullptr; |
384 CHECK(manifest->GetAsDictionary(&dictionary)); | 384 CHECK(manifest->GetAsDictionary(&dictionary)); |
385 DeserializeApplication(dictionary); | 385 DeserializeApplication(dictionary); |
386 SerializeCatalog(); | 386 SerializeCatalog(); |
387 } | 387 } |
388 | 388 |
389 } // namespace shell | 389 } // namespace shell |
390 } // namespace mojo | 390 } // namespace mojo |
OLD | NEW |