| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_INSTANCE_H_ | 5 #ifndef MOJO_SHELL_APPLICATION_INSTANCE_H_ |
| 6 #define MOJO_SHELL_APPLICATION_INSTANCE_H_ | 6 #define MOJO_SHELL_APPLICATION_INSTANCE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 // Encapsulates a connection to an instance of an application, tracked by the | 50 // Encapsulates a connection to an instance of an application, tracked by the |
| 51 // shell's ApplicationManager. | 51 // shell's ApplicationManager. |
| 52 class ApplicationInstance : public Shell { | 52 class ApplicationInstance : public Shell { |
| 53 public: | 53 public: |
| 54 using AllowedInterfaces = std::set<std::string>; | 54 using AllowedInterfaces = std::set<std::string>; |
| 55 using CapabilityFilter = std::map<std::string, AllowedInterfaces>; | 55 using CapabilityFilter = std::map<std::string, AllowedInterfaces>; |
| 56 | 56 |
| 57 ApplicationInstance(ApplicationPtr application, | 57 ApplicationInstance(ApplicationPtr application, |
| 58 ApplicationManager* manager, | 58 ApplicationManager* manager, |
| 59 const Identity& originator_identity, |
| 59 const Identity& resolved_identity, | 60 const Identity& resolved_identity, |
| 60 const CapabilityFilter& filter, | 61 const CapabilityFilter& filter, |
| 61 const base::Closure& on_application_end); | 62 const base::Closure& on_application_end); |
| 62 | 63 |
| 63 ~ApplicationInstance() override; | 64 ~ApplicationInstance() override; |
| 64 | 65 |
| 65 void InitializeApplication(); | 66 void InitializeApplication(); |
| 66 | 67 |
| 67 void ConnectToClient(ApplicationInstance* originator, | 68 void ConnectToClient(ApplicationInstance* originator, |
| 68 const GURL& requested_url, | 69 const GURL& requested_url, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 ~QueuedClientRequest(); | 103 ~QueuedClientRequest(); |
| 103 ApplicationInstance* originator; | 104 ApplicationInstance* originator; |
| 104 GURL requested_url; | 105 GURL requested_url; |
| 105 GURL requestor_url; | 106 GURL requestor_url; |
| 106 InterfaceRequest<ServiceProvider> services; | 107 InterfaceRequest<ServiceProvider> services; |
| 107 ServiceProviderPtr exposed_services; | 108 ServiceProviderPtr exposed_services; |
| 108 CapabilityFilterPtr filter; | 109 CapabilityFilterPtr filter; |
| 109 }; | 110 }; |
| 110 | 111 |
| 111 ApplicationManager* const manager_; | 112 ApplicationManager* const manager_; |
| 113 const Identity originator_identity_; |
| 112 const Identity identity_; | 114 const Identity identity_; |
| 113 const CapabilityFilter filter_; | 115 const CapabilityFilter filter_; |
| 114 const bool allow_any_application_; | 116 const bool allow_any_application_; |
| 115 base::Closure on_application_end_; | 117 base::Closure on_application_end_; |
| 116 ApplicationPtr application_; | 118 ApplicationPtr application_; |
| 117 Binding<Shell> binding_; | 119 Binding<Shell> binding_; |
| 118 bool queue_requests_; | 120 bool queue_requests_; |
| 119 std::vector<QueuedClientRequest*> queued_client_requests_; | 121 std::vector<QueuedClientRequest*> queued_client_requests_; |
| 120 | 122 |
| 121 DISALLOW_COPY_AND_ASSIGN(ApplicationInstance); | 123 DISALLOW_COPY_AND_ASSIGN(ApplicationInstance); |
| 122 }; | 124 }; |
| 123 | 125 |
| 124 } // namespace shell | 126 } // namespace shell |
| 125 } // namespace mojo | 127 } // namespace mojo |
| 126 | 128 |
| 127 #endif // MOJO_SHELL_APPLICATION_INSTANCE_H_ | 129 #endif // MOJO_SHELL_APPLICATION_INSTANCE_H_ |
| OLD | NEW |