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

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') | mojo/shell/desktop/mojo_main.cc » ('J')
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 75ef7a76694b24773a65b38e644d83bd901d1ce9..4d1037a6e0265deaafd99b0272a63c323766b208 100644
--- a/mojo/application_manager/application_manager.cc
+++ b/mojo/application_manager/application_manager.cc
@@ -100,8 +100,12 @@ class ApplicationManager::ShellImpl : public InterfaceImpl<Shell> {
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());
}
const GURL& url() const { return url_; }
@@ -175,6 +179,7 @@ void ApplicationManager::ConnectToApplication(
const GURL& url,
const GURL& requestor_url,
ServiceProviderPtr service_provider) {
+ DCHECK(url.is_valid());
URLToShellImplMap::const_iterator shell_it = url_to_shell_impl_.find(url);
if (shell_it != url_to_shell_impl_.end()) {
ConnectToClient(
« no previous file with comments | « no previous file | mojo/shell/desktop/mojo_main.cc » ('j') | mojo/shell/desktop/mojo_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698