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..b60ca840483f3a17fffabd766278937636e5965a 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,14 +73,16 @@ 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(); |
@@ -89,8 +90,8 @@ class ApplicationImpl : public InterfaceImpl<Application> { |
private: |
class ShellPtrWatcher; |
- void BindShell(ScopedMessagePipeHandle shell_handle); |
void ClearConnections(); |
+ |
void OnShellError() { |
ClearConnections(); |
Terminate(); |
@@ -108,6 +109,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_; |