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

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: 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
« 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..f4956d00585df5c2f2216a2196e6da6f294e91bf 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() && app_gurl.possibly_invalid_spec().size() == 0) {
Aaron Boodman 2014/11/20 21:53:59 This is the first code that gets called when some
azani 2014/11/20 22:10:03 Done.
+ LOG(ERROR) << "Error: invalid URL: " << app_url;
Aaron Boodman 2014/11/20 21:53:59 return here. The InterfaceRequest will get destroy
azani 2014/11/20 22:10:03 Done.
+ }
+ DCHECK(app_gurl.possibly_invalid_spec().size() > 0);
Aaron Boodman 2014/11/20 21:53:59 This moves to ApplicationManager::ConnectToApplica
azani 2014/11/20 22:10:03 Done.
+ manager_->ConnectToApplication(app_gurl, url_, out_service_provider.Pass());
}
const GURL& url() const { return url_; }
« 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