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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/application_manager/application_manager.h" 5 #include "mojo/application_manager/application_manager.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 void ConnectToClient(const GURL& requestor_url, 91 void ConnectToClient(const GURL& requestor_url,
92 ServiceProviderPtr service_provider) { 92 ServiceProviderPtr service_provider) {
93 client()->AcceptConnection(String::From(requestor_url), 93 client()->AcceptConnection(String::From(requestor_url),
94 service_provider.Pass()); 94 service_provider.Pass());
95 } 95 }
96 96
97 // ServiceProvider implementation: 97 // ServiceProvider implementation:
98 void ConnectToApplication( 98 void ConnectToApplication(
99 const String& app_url, 99 const String& app_url,
100 InterfaceRequest<ServiceProvider> in_service_provider) override { 100 InterfaceRequest<ServiceProvider> in_service_provider) override {
101 GURL app_gurl(app_url.get());
Aaron Boodman 2014/11/19 20:29:28 If we were going to check the URL before requestin
102 if (!app_gurl.is_valid()) {
103 LOG(ERROR) << "Error: \"" << app_url << "\" is not a valid URL.";
104 }
101 ServiceProviderPtr out_service_provider; 105 ServiceProviderPtr out_service_provider;
102 out_service_provider.Bind(in_service_provider.PassMessagePipe()); 106 out_service_provider.Bind(in_service_provider.PassMessagePipe());
103 manager_->ConnectToApplication( 107 manager_->ConnectToApplication(
104 app_url.To<GURL>(), url_, out_service_provider.Pass()); 108 app_gurl, url_, out_service_provider.Pass());
105 } 109 }
106 110
107 const GURL& url() const { return url_; } 111 const GURL& url() const { return url_; }
108 112
109 private: 113 private:
110 void OnConnectionError() override { manager_->OnShellImplError(this); } 114 void OnConnectionError() override { manager_->OnShellImplError(this); }
111 115
112 ApplicationManager* const manager_; 116 ApplicationManager* const manager_;
113 const GURL url_; 117 const GURL url_;
114 118
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 StubServiceProvider* stub_sp = new StubServiceProvider; 320 StubServiceProvider* stub_sp = new StubServiceProvider;
317 ServiceProviderPtr spp; 321 ServiceProviderPtr spp;
318 BindToProxy(stub_sp, &spp); 322 BindToProxy(stub_sp, &spp);
319 ConnectToApplication(application_url, GURL(), spp.Pass()); 323 ConnectToApplication(application_url, GURL(), spp.Pass());
320 MessagePipe pipe; 324 MessagePipe pipe;
321 stub_sp->GetRemoteServiceProvider()->ConnectToService(interface_name, 325 stub_sp->GetRemoteServiceProvider()->ConnectToService(interface_name,
322 pipe.handle1.Pass()); 326 pipe.handle1.Pass());
323 return pipe.handle0.Pass(); 327 return pipe.handle0.Pass();
324 } 328 }
325 } // namespace mojo 329 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/shell/dynamic_application_loader.cc » ('j') | mojo/shell/dynamic_application_loader.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698