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

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

Issue 735863002: Emit an error log line when attempting to connect to an app at an invalid URL. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
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_application_loader.h" 5 #include "mojo/shell/dynamic_application_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/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 base::Bind(&DynamicApplicationLoader::LoaderComplete, 204 base::Bind(&DynamicApplicationLoader::LoaderComplete,
205 base::Unretained(this))) { 205 base::Unretained(this))) {
206 } 206 }
207 207
208 DynamicApplicationLoader::~DynamicApplicationLoader() { 208 DynamicApplicationLoader::~DynamicApplicationLoader() {
209 } 209 }
210 210
211 void DynamicApplicationLoader::RegisterContentHandler( 211 void DynamicApplicationLoader::RegisterContentHandler(
212 const std::string& mime_type, 212 const std::string& mime_type,
213 const GURL& content_handler_url) { 213 const GURL& content_handler_url) {
214 DCHECK(content_handler_url.is_valid())
215 << "Content handler URL is invalid for mime type " << mime_type;
214 mime_type_to_url_[mime_type] = content_handler_url; 216 mime_type_to_url_[mime_type] = content_handler_url;
215 } 217 }
216 218
217 void DynamicApplicationLoader::Load( 219 void DynamicApplicationLoader::Load(
218 ApplicationManager* manager, 220 ApplicationManager* manager,
219 const GURL& url, 221 const GURL& url,
220 scoped_refptr<LoadCallbacks> load_callbacks) { 222 scoped_refptr<LoadCallbacks> load_callbacks) {
221 GURL resolved_url; 223 GURL resolved_url;
222 if (url.SchemeIs("mojo")) { 224 if (url.SchemeIs("mojo")) {
223 resolved_url = context_->mojo_url_resolver()->Resolve(url); 225 resolved_url = context_->mojo_url_resolver()->Resolve(url);
(...skipping 29 matching lines...) Expand all
253 // TODO(darin): What should we do about service errors? This implies that 255 // TODO(darin): What should we do about service errors? This implies that
254 // the app closed its handle to the service manager. Maybe we don't care? 256 // the app closed its handle to the service manager. Maybe we don't care?
255 } 257 }
256 258
257 void DynamicApplicationLoader::LoaderComplete(Loader* loader) { 259 void DynamicApplicationLoader::LoaderComplete(Loader* loader) {
258 loaders_.erase(std::find(loaders_.begin(), loaders_.end(), loader)); 260 loaders_.erase(std::find(loaders_.begin(), loaders_.end(), loader));
259 } 261 }
260 262
261 } // namespace shell 263 } // namespace shell
262 } // namespace mojo 264 } // namespace mojo
OLDNEW
« mojo/shell/desktop/mojo_main.cc ('K') | « mojo/shell/desktop/mojo_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698