| 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/dynamic_service_loader.h" | 5 #include "mojo/shell/dynamic_service_loader.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 if (url.SchemeIs("mojo")) { | 160 if (url.SchemeIs("mojo")) { |
| 161 resolved_url = context_->mojo_url_resolver()->Resolve(url); | 161 resolved_url = context_->mojo_url_resolver()->Resolve(url); |
| 162 } else { | 162 } else { |
| 163 resolved_url = url; | 163 resolved_url = url; |
| 164 } | 164 } |
| 165 | 165 |
| 166 Loader* loader; | 166 Loader* loader; |
| 167 if (resolved_url.SchemeIsFile()) { | 167 if (resolved_url.SchemeIsFile()) { |
| 168 loader = new LocalLoader(runner.Pass()); | 168 loader = new LocalLoader(runner.Pass()); |
| 169 } else { | 169 } else { |
| 170 if (!network_service_.get()) { | 170 if (!network_service_) { |
| 171 context_->service_manager()->ConnectToService( | 171 context_->service_manager()->ConnectToService( |
| 172 GURL("mojo:mojo_network_service"), | 172 GURL("mojo:mojo_network_service"), |
| 173 &network_service_); | 173 &network_service_); |
| 174 } | 174 } |
| 175 loader = new NetworkLoader(runner.Pass(), network_service_.get()); | 175 loader = new NetworkLoader(runner.Pass(), network_service_.get()); |
| 176 } | 176 } |
| 177 loader->Start(resolved_url, shell_handle.Pass(), context_); | 177 loader->Start(resolved_url, shell_handle.Pass(), context_); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void DynamicServiceLoader::OnServiceError(ServiceManager* manager, | 180 void DynamicServiceLoader::OnServiceError(ServiceManager* manager, |
| 181 const GURL& url) { | 181 const GURL& url) { |
| 182 // TODO(darin): What should we do about service errors? This implies that | 182 // TODO(darin): What should we do about service errors? This implies that |
| 183 // the app closed its handle to the service manager. Maybe we don't care? | 183 // the app closed its handle to the service manager. Maybe we don't care? |
| 184 } | 184 } |
| 185 | 185 |
| 186 } // namespace shell | 186 } // namespace shell |
| 187 } // namespace mojo | 187 } // namespace mojo |
| OLD | NEW |