Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Side by Side Diff: mojo/shell/dynamic_service_loader.cc

Issue 405653003: mojo: Make InterfacePtr<> testable in if() statements without .get(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move to is_bound() Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/services/view_manager/view_manager_init_service_impl.cc ('k') | mojo/spy/spy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « mojo/services/view_manager/view_manager_init_service_impl.cc ('k') | mojo/spy/spy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698