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

Unified Diff: third_party/mojo/src/mojo/public/cpp/application/application_impl.h

Issue 883843002: Update mojo sdk to rev 126532ce21c5c3c55a1e1693731411cb60169efd (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review 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
Index: third_party/mojo/src/mojo/public/cpp/application/application_impl.h
diff --git a/third_party/mojo/src/mojo/public/cpp/application/application_impl.h b/third_party/mojo/src/mojo/public/cpp/application/application_impl.h
index 430a1246aca48fd75a22c73fa9902021d070f701..bb92307f00ad1c48d4287182e7ab256821ecf4f7 100644
--- a/third_party/mojo/src/mojo/public/cpp/application/application_impl.h
+++ b/third_party/mojo/src/mojo/public/cpp/application/application_impl.h
@@ -50,11 +50,10 @@ class ApplicationDelegate;
// app.AddService<BarImpl>(&context);
//
//
-class ApplicationImpl : public InterfaceImpl<Application> {
+class ApplicationImpl : public Application {
public:
ApplicationImpl(ApplicationDelegate* delegate,
- ScopedMessagePipeHandle shell_handle);
- ApplicationImpl(ApplicationDelegate* delegate, MojoHandle shell_handle);
+ InterfaceRequest<Application> request);
~ApplicationImpl() override;
Shell* shell() const { return shell_.get(); }
@@ -74,32 +73,36 @@ class ApplicationImpl : public InterfaceImpl<Application> {
ConnectToApplication(application_url)->ConnectToService(ptr);
}
- // Wait for the ShellPtr's Initialize message.
- bool WaitForInitialize();
+ // Application implementation.
+ void Initialize(ShellPtr shell, Array<String> args) override;
- // Unbind the shell from this application and return its handle.
- ScopedMessagePipeHandle UnbindShell();
+ // Block until the Application is initialized, if it is not already.
+ void WaitForInitialize();
- // Application implementation.
- void Initialize(Array<String> args) override;
+ // Unbinds the Shell and Application connections. Must be called after
+ // Initialize.
+ void UnbindConnections(InterfaceRequest<Application>* application_request,
+ ShellPtr* shell);
// Quits the main run loop for this application.
static void Terminate();
+ protected:
+ // Application implementation.
+ void AcceptConnection(const String& requestor_url,
+ InterfaceRequest<ServiceProvider> services,
+ ServiceProviderPtr exposed_services) override;
+
private:
class ShellPtrWatcher;
- void BindShell(ScopedMessagePipeHandle shell_handle);
void ClearConnections();
+
void OnShellError() {
ClearConnections();
Terminate();
}
- // Application implementation.
- void AcceptConnection(const String& requestor_url,
- InterfaceRequest<ServiceProvider> services,
- ServiceProviderPtr exposed_services) override;
void RequestQuit() override;
typedef std::vector<internal::ServiceRegistry*> ServiceRegistryList;
@@ -108,6 +111,7 @@ class ApplicationImpl : public InterfaceImpl<Application> {
ServiceRegistryList incoming_service_registries_;
ServiceRegistryList outgoing_service_registries_;
ApplicationDelegate* delegate_;
+ Binding<Application> binding_;
ShellPtr shell_;
ShellPtrWatcher* shell_watch_;
std::vector<std::string> args_;

Powered by Google App Engine
This is Rietveld 408576698