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

Side by Side Diff: mojo/application/public/cpp/application_impl.h

Issue 1423063004: Allow Chrome to bind an Application request from mojo_runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@callback
Patch Set: . Created 5 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 #ifndef MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_ 5 #ifndef MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_
6 #define MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_ 6 #define MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 template <typename Interface> 107 template <typename Interface>
108 void ConnectToService(mojo::URLRequestPtr request, 108 void ConnectToService(mojo::URLRequestPtr request,
109 InterfacePtr<Interface>* ptr) { 109 InterfacePtr<Interface>* ptr) {
110 scoped_ptr<ApplicationConnection> connection = 110 scoped_ptr<ApplicationConnection> connection =
111 ConnectToApplication(request.Pass()); 111 ConnectToApplication(request.Pass());
112 if (!connection.get()) 112 if (!connection.get())
113 return; 113 return;
114 connection->ConnectToService(ptr); 114 connection->ConnectToService(ptr);
115 } 115 }
116 116
117 // Block the calling thread until the Initialize() method is called by the
118 // shell.
119 void WaitForInitialize();
120
117 // Initiate shutdown of this application. This may involve a round trip to the 121 // Initiate shutdown of this application. This may involve a round trip to the
118 // Shell to ensure there are no inbound service requests. 122 // Shell to ensure there are no inbound service requests.
119 void Quit(); 123 void Quit();
120 124
121 private: 125 private:
122 // Application implementation. 126 // Application implementation.
123 void Initialize(ShellPtr shell, const mojo::String& url) override; 127 void Initialize(ShellPtr shell, const mojo::String& url) override;
124 void AcceptConnection(const String& requestor_url, 128 void AcceptConnection(const String& requestor_url,
125 InterfaceRequest<ServiceProvider> services, 129 InterfaceRequest<ServiceProvider> services,
126 ServiceProviderPtr exposed_services, 130 ServiceProviderPtr exposed_services,
(...skipping 24 matching lines...) Expand all
151 AppLifetimeHelper app_lifetime_helper_; 155 AppLifetimeHelper app_lifetime_helper_;
152 bool quit_requested_; 156 bool quit_requested_;
153 base::WeakPtrFactory<ApplicationImpl> weak_factory_; 157 base::WeakPtrFactory<ApplicationImpl> weak_factory_;
154 158
155 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl); 159 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
156 }; 160 };
157 161
158 } // namespace mojo 162 } // namespace mojo
159 163
160 #endif // MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_ 164 #endif // MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_
OLDNEW
« no previous file with comments | « components/mus/example/main/main_application_delegate.cc ('k') | mojo/application/public/cpp/lib/application_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698