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

Unified Diff: mojo/shell/desktop/mojo_main.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: Check that specified URLs for applications are good. 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 side-by-side diff with in-line comments
Download patch
Index: mojo/shell/desktop/mojo_main.cc
diff --git a/mojo/shell/desktop/mojo_main.cc b/mojo/shell/desktop/mojo_main.cc
index 02be823e8ef4475412f11d99d1cf8c7a6c6e1591..672b97b8d8ae96cc074c607dec61e1551e481882 100644
--- a/mojo/shell/desktop/mojo_main.cc
+++ b/mojo/shell/desktop/mojo_main.cc
@@ -57,6 +57,10 @@ GURL GetAppURLAndSetArgs(const base::CommandLine::StringType& app_url_and_args,
if (argv.empty())
return GURL::EmptyGURL();
GURL app_url(argv[0]);
+ if (!app_url.is_valid() && app_url.possibly_invalid_spec().size() == 0) {
+ LOG(ERROR) << "Error: invalid URL: " << argv[0];
Aaron Boodman 2014/11/20 21:53:59 same feedback as in other file.
azani 2014/11/20 22:10:03 Done.
+ }
+ DCHECK(app_url.possibly_invalid_spec().size() > 0);
if (argv.size() > 1)
context->application_manager()->SetArgsForURL(argv, app_url);
return app_url;

Powered by Google App Engine
This is Rietveld 408576698