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

Unified Diff: mojo/public/cpp/application/application_connection.h

Issue 858103002: Remove [Client=] annotation from ServiceProvider (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase for trybots (no code changes from ps2) Created 5 years, 11 months 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/public/cpp/application/BUILD.gn ('k') | mojo/public/cpp/application/lib/service_provider_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/application/application_connection.h
diff --git a/mojo/public/cpp/application/application_connection.h b/mojo/public/cpp/application/application_connection.h
index d5d6ddec62140b2707aa4f370f9890a8f9c5730e..ca6ea077ed8742a1895b5ed8cc55396c6ea76d11 100644
--- a/mojo/public/cpp/application/application_connection.h
+++ b/mojo/public/cpp/application/application_connection.h
@@ -47,10 +47,11 @@ class ApplicationConnection {
// Connect to the service implementing |Interface|.
template <typename Interface>
void ConnectToService(InterfacePtr<Interface>* ptr) {
- MessagePipe pipe;
- ptr->Bind(pipe.handle0.Pass());
- GetServiceProvider()->ConnectToService(Interface::Name_,
- pipe.handle1.Pass());
+ if (ServiceProvider* sp = GetServiceProvider()) {
+ MessagePipe pipe;
+ ptr->Bind(pipe.handle0.Pass());
+ sp->ConnectToService(Interface::Name_, pipe.handle1.Pass());
+ }
}
// The url identifying the application on the other end of this connection.
« no previous file with comments | « mojo/public/cpp/application/BUILD.gn ('k') | mojo/public/cpp/application/lib/service_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698