| 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_SHELL_APPLICATION_MANAGER_H_ | 5 #ifndef MOJO_SHELL_APPLICATION_MANAGER_H_ |
| 6 #define MOJO_SHELL_APPLICATION_MANAGER_H_ | 6 #define MOJO_SHELL_APPLICATION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // Destroys all Shell-ends of connections established with Applications. | 85 // Destroys all Shell-ends of connections established with Applications. |
| 86 // Applications connected by this ApplicationManager will observe pipe errors | 86 // Applications connected by this ApplicationManager will observe pipe errors |
| 87 // and have a chance to shutdown. | 87 // and have a chance to shutdown. |
| 88 void TerminateShellConnections(); | 88 void TerminateShellConnections(); |
| 89 | 89 |
| 90 // Removes a ApplicationInstance when it encounters an error. | 90 // Removes a ApplicationInstance when it encounters an error. |
| 91 void OnApplicationInstanceError(ApplicationInstance* instance); | 91 void OnApplicationInstanceError(ApplicationInstance* instance); |
| 92 | 92 |
| 93 ApplicationInstance* GetApplicationInstance(const Identity& identity) const; | 93 ApplicationInstance* GetApplicationInstance(const Identity& identity) const; |
| 94 | 94 |
| 95 void CreateInstanceForHandle(ScopedHandle channel, const GURL& url); | 95 void CreateInstanceForHandle(ScopedHandle channel, |
| 96 const GURL& url, |
| 97 CapabilityFilterPtr filter); |
| 96 | 98 |
| 97 private: | 99 private: |
| 98 using IdentityToInstanceMap = std::map<Identity, ApplicationInstance*>; | 100 using IdentityToInstanceMap = std::map<Identity, ApplicationInstance*>; |
| 99 using URLToLoaderMap = std::map<GURL, ApplicationLoader*>; | 101 using URLToLoaderMap = std::map<GURL, ApplicationLoader*>; |
| 100 | 102 |
| 101 // Takes the contents of |params| only when it returns true. | 103 // Takes the contents of |params| only when it returns true. |
| 102 bool ConnectToRunningApplication( | 104 bool ConnectToRunningApplication( |
| 103 scoped_ptr<ConnectToApplicationParams>* params); | 105 scoped_ptr<ConnectToApplicationParams>* params); |
| 104 | 106 |
| 105 InterfaceRequest<Application> CreateAndConnectToInstance( | 107 InterfaceRequest<Application> CreateAndConnectToInstance( |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 145 |
| 144 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); | 146 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); |
| 145 }; | 147 }; |
| 146 | 148 |
| 147 Shell::ConnectToApplicationCallback EmptyConnectCallback(); | 149 Shell::ConnectToApplicationCallback EmptyConnectCallback(); |
| 148 | 150 |
| 149 } // namespace shell | 151 } // namespace shell |
| 150 } // namespace mojo | 152 } // namespace mojo |
| 151 | 153 |
| 152 #endif // MOJO_SHELL_APPLICATION_MANAGER_H_ | 154 #endif // MOJO_SHELL_APPLICATION_MANAGER_H_ |
| OLD | NEW |