| OLD | NEW |
| 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_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ | 5 #ifndef MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ |
| 6 #define MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ | 6 #define MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "mojo/public/cpp/application/application_connection.h" | 9 #include "mojo/public/cpp/application/application_connection.h" |
| 10 #include "mojo/public/cpp/application/lib/service_connector.h" | 10 #include "mojo/public/cpp/application/lib/service_connector.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 explicit ShellPtrWatcher(ApplicationImpl* impl); | 75 explicit ShellPtrWatcher(ApplicationImpl* impl); |
| 76 virtual ~ShellPtrWatcher(); | 76 virtual ~ShellPtrWatcher(); |
| 77 virtual void OnConnectionError() MOJO_OVERRIDE; | 77 virtual void OnConnectionError() MOJO_OVERRIDE; |
| 78 private: | 78 private: |
| 79 ApplicationImpl* impl_; | 79 ApplicationImpl* impl_; |
| 80 MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher); | 80 MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 void BindShell(ScopedMessagePipeHandle shell_handle); | 83 void BindShell(ScopedMessagePipeHandle shell_handle); |
| 84 void ClearConnections(); | 84 void ClearConnections(); |
| 85 void OnShellError() { ClearConnections(); Terminate(); }; | 85 void OnShellError() { |
| 86 ClearConnections(); |
| 87 Terminate(); |
| 88 }; |
| 86 | 89 |
| 87 // Quits the main run loop for this application. | 90 // Quits the main run loop for this application. |
| 88 static void Terminate(); | 91 static void Terminate(); |
| 89 | 92 |
| 90 // Application implementation. | 93 // Application implementation. |
| 91 virtual void AcceptConnection(const String& requestor_url, | 94 virtual void AcceptConnection(const String& requestor_url, |
| 92 ServiceProviderPtr provider) MOJO_OVERRIDE; | 95 ServiceProviderPtr provider) MOJO_OVERRIDE; |
| 93 | 96 |
| 94 typedef std::vector<internal::ServiceRegistry*> ServiceRegistryList; | 97 typedef std::vector<internal::ServiceRegistry*> ServiceRegistryList; |
| 95 ServiceRegistryList incoming_service_registries_; | 98 ServiceRegistryList incoming_service_registries_; |
| 96 ServiceRegistryList outgoing_service_registries_; | 99 ServiceRegistryList outgoing_service_registries_; |
| 97 ApplicationDelegate* delegate_; | 100 ApplicationDelegate* delegate_; |
| 98 ShellPtr shell_; | 101 ShellPtr shell_; |
| 99 ShellPtrWatcher shell_watch_; | 102 ShellPtrWatcher shell_watch_; |
| 100 | 103 |
| 101 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl); | 104 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl); |
| 102 }; | 105 }; |
| 103 | 106 |
| 104 } // namespace mojo | 107 } // namespace mojo |
| 105 | 108 |
| 106 #endif // MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ | 109 #endif // MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ |
| OLD | NEW |