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

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: 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
« no previous file with comments | « mojo/application_manager/application_manager.cc ('k') | mojo/shell/dynamic_application_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/desktop/mojo_main.cc
diff --git a/mojo/shell/desktop/mojo_main.cc b/mojo/shell/desktop/mojo_main.cc
index caa84e0c6aaf4bb926579d1ce54db573b9c69c82..cda28f62bbd01b90a668072294ef753182a18bb7 100644
--- a/mojo/shell/desktop/mojo_main.cc
+++ b/mojo/shell/desktop/mojo_main.cc
@@ -43,6 +43,10 @@ GURL GetAppURLAndSetArgs(const std::string& app_url_and_args,
if (argv.empty())
return GURL::EmptyGURL();
GURL app_url(argv[0]);
+ if (!app_url.is_valid()) {
+ LOG(ERROR) << "Error: invalid URL: " << argv[0];
+ return app_url;
+ }
if (argv.size() > 1)
context->application_manager()->SetArgsForURL(argv, app_url);
return app_url;
@@ -57,6 +61,9 @@ void RunApps(mojo::shell::Context* context) {
#else
arg2 = arg;
#endif
+ GURL url = GetAppURLAndSetArgs(arg2, context);
+ if (!url.is_valid())
+ return;
context->Run(GetAppURLAndSetArgs(arg2, context));
}
}
« no previous file with comments | « mojo/application_manager/application_manager.cc ('k') | mojo/shell/dynamic_application_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698