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

Unified Diff: mojo/application_manager/application_manager.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 | « no previous file | mojo/shell/desktop/mojo_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/application_manager/application_manager.cc
diff --git a/mojo/application_manager/application_manager.cc b/mojo/application_manager/application_manager.cc
index e99c627cf74cfeca6e60b1230856e23d25152136..443c3f1986f1fcdc22ac12e1615b5043936155cf 100644
--- a/mojo/application_manager/application_manager.cc
+++ b/mojo/application_manager/application_manager.cc
@@ -146,8 +146,12 @@ class ApplicationManager::ShellImpl : public Shell, public ErrorHandler {
InterfaceRequest<ServiceProvider> in_service_provider) override {
ServiceProviderPtr out_service_provider;
out_service_provider.Bind(in_service_provider.PassMessagePipe());
- manager_->ConnectToApplication(
- app_url.To<GURL>(), url_, out_service_provider.Pass());
+ GURL app_gurl(app_url);
+ if (!app_gurl.is_valid()) {
+ LOG(ERROR) << "Error: invalid URL: " << app_url;
+ return;
+ }
+ manager_->ConnectToApplication(app_gurl, url_, out_service_provider.Pass());
}
// ErrorHandler implementation:
@@ -229,6 +233,7 @@ void ApplicationManager::ConnectToApplication(
const GURL& requested_url,
const GURL& requestor_url,
ServiceProviderPtr service_provider) {
+ DCHECK(requested_url.is_valid());
ApplicationLoader* loader = GetLoaderForURL(requested_url,
DONT_INCLUDE_DEFAULT_LOADER);
if (loader) {
« no previous file with comments | « no previous file | mojo/shell/desktop/mojo_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698