 Chromium Code Reviews
 Chromium Code Reviews Issue 1444433002:
  Added anti-singleton services (new process/thread per connection).  (Closed) 
  Base URL: https://github.com/domokit/mojo.git@master
    
  
    Issue 1444433002:
  Added anti-singleton services (new process/thread per connection).  (Closed) 
  Base URL: https://github.com/domokit/mojo.git@master| 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 SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 5 #ifndef SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 
| 6 #define SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 6 #define SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 
| 7 | 7 | 
| 8 #include <map> | 8 #include <map> | 
| 9 | 9 | 
| 10 #include "base/macros.h" | 10 #include "base/macros.h" | 
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 // Removes a ShellImpl when it encounters an error. | 139 // Removes a ShellImpl when it encounters an error. | 
| 140 void OnShellImplError(ShellImpl* shell_impl); | 140 void OnShellImplError(ShellImpl* shell_impl); | 
| 141 | 141 | 
| 142 private: | 142 private: | 
| 143 class ContentHandlerConnection; | 143 class ContentHandlerConnection; | 
| 144 | 144 | 
| 145 using URLToLoaderMap = std::map<GURL, scoped_ptr<ApplicationLoader>>; | 145 using URLToLoaderMap = std::map<GURL, scoped_ptr<ApplicationLoader>>; | 
| 146 using SchemeToLoaderMap = | 146 using SchemeToLoaderMap = | 
| 147 std::map<std::string, scoped_ptr<ApplicationLoader>>; | 147 std::map<std::string, scoped_ptr<ApplicationLoader>>; | 
| 148 using IdentityToShellImplMap = std::map<Identity, scoped_ptr<ShellImpl>>; | 148 using IdentityToShellImplMap = std::map<Identity, scoped_ptr<ShellImpl>>; | 
| 149 using URLToContentHandlerMap = | 149 using IdentityToContentHandlerMap = | 
| 150 std::map<GURL, scoped_ptr<ContentHandlerConnection>>; | 150 std::map<Identity, scoped_ptr<ContentHandlerConnection>>; | 
| 151 using URLToArgsMap = std::map<GURL, std::vector<std::string>>; | 151 using URLToArgsMap = std::map<GURL, std::vector<std::string>>; | 
| 152 using MimeTypeToURLMap = std::map<std::string, GURL>; | 152 using MimeTypeToURLMap = std::map<std::string, GURL>; | 
| 153 using URLToNativeOptionsMap = std::map<GURL, NativeApplicationOptions>; | 153 using URLToNativeOptionsMap = std::map<GURL, NativeApplicationOptions>; | 
| 154 | 154 | 
| 155 void ConnectToApplicationWithParameters( | 155 void ConnectToApplicationWithParameters( | 
| 156 const GURL& application_url, | 156 const GURL& application_url, | 
| 157 const GURL& requestor_url, | 157 const GURL& requestor_url, | 
| 158 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 158 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 
| 159 mojo::ServiceProviderPtr exposed_services, | 159 mojo::ServiceProviderPtr exposed_services, | 
| 160 const base::Closure& on_application_end, | 160 const base::Closure& on_application_end, | 
| 161 const std::vector<std::string>& pre_redirect_parameters); | 161 const std::vector<std::string>& pre_redirect_parameters); | 
| 162 | 162 | 
| 163 bool ConnectToRunningApplication( | 163 bool ConnectToRunningApplication( | 
| 164 const GURL& resolved_url, | 164 const GURL& resolved_url, | 
| 165 const GURL& requestor_url, | 165 const GURL& requestor_url, | 
| 166 mojo::InterfaceRequest<mojo::ServiceProvider>* services, | 166 mojo::InterfaceRequest<mojo::ServiceProvider>* services, | 
| 167 mojo::ServiceProviderPtr* exposed_services); | 167 mojo::ServiceProviderPtr* exposed_services); | 
| 168 | 168 | 
| 169 bool ConnectToApplicationWithLoader( | 169 bool ConnectToApplicationWithLoader( | 
| 170 const GURL& resolved_url, | 170 const GURL& resolved_url, | 
| 171 const GURL& requestor_url, | 171 const GURL& requestor_url, | 
| 172 mojo::InterfaceRequest<mojo::ServiceProvider>* services, | 172 mojo::InterfaceRequest<mojo::ServiceProvider>* services, | 
| 173 mojo::ServiceProviderPtr* exposed_services, | 173 mojo::ServiceProviderPtr* exposed_services, | 
| 174 const base::Closure& on_application_end, | 174 const base::Closure& on_application_end, | 
| 175 const std::vector<std::string>& parameters, | 175 const std::vector<std::string>& parameters, | 
| 176 ApplicationLoader* loader); | 176 ApplicationLoader* loader); | 
| 177 | 177 | 
| 178 Identity MakeApplicationIdentity(const GURL& resolved_url); | |
| 
viettrungluu
2015/11/16 17:13:32
nit: Existing bad precedent notwithstanding, pleas
 
Sean Klein
2015/11/16 17:26:32
Done.
 | |
| 179 | |
| 178 mojo::InterfaceRequest<mojo::Application> RegisterShell( | 180 mojo::InterfaceRequest<mojo::Application> RegisterShell( | 
| 179 // The URL after resolution and redirects, including the querystring. | 181 // The URL after resolution and redirects, including the querystring. | 
| 180 const GURL& resolved_url, | 182 const GURL& resolved_url, | 
| 181 const GURL& requestor_url, | 183 const GURL& requestor_url, | 
| 182 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 184 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 
| 183 mojo::ServiceProviderPtr exposed_services, | 185 mojo::ServiceProviderPtr exposed_services, | 
| 184 const base::Closure& on_application_end, | 186 const base::Closure& on_application_end, | 
| 185 const std::vector<std::string>& parameters); | 187 const std::vector<std::string>& parameters); | 
| 186 | 188 | 
| 187 ShellImpl* GetShellImpl(const GURL& url); | 189 ShellImpl* GetShellImpl(const GURL& url); | 
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 const Options options_; | 229 const Options options_; | 
| 228 Delegate* const delegate_; | 230 Delegate* const delegate_; | 
| 229 // Loader management. | 231 // Loader management. | 
| 230 // Loaders are chosen in the order they are listed here. | 232 // Loaders are chosen in the order they are listed here. | 
| 231 URLToLoaderMap url_to_loader_; | 233 URLToLoaderMap url_to_loader_; | 
| 232 SchemeToLoaderMap scheme_to_loader_; | 234 SchemeToLoaderMap scheme_to_loader_; | 
| 233 scoped_ptr<ApplicationLoader> default_loader_; | 235 scoped_ptr<ApplicationLoader> default_loader_; | 
| 234 scoped_ptr<NativeRunnerFactory> native_runner_factory_; | 236 scoped_ptr<NativeRunnerFactory> native_runner_factory_; | 
| 235 | 237 | 
| 236 IdentityToShellImplMap identity_to_shell_impl_; | 238 IdentityToShellImplMap identity_to_shell_impl_; | 
| 237 URLToContentHandlerMap url_to_content_handler_; | 239 IdentityToContentHandlerMap identity_to_content_handler_; | 
| 238 URLToArgsMap url_to_args_; | 240 URLToArgsMap url_to_args_; | 
| 239 // Note: The keys are URLs after mapping and resolving. | 241 // Note: The keys are URLs after mapping and resolving. | 
| 240 URLToNativeOptionsMap url_to_native_options_; | 242 URLToNativeOptionsMap url_to_native_options_; | 
| 241 | 243 | 
| 242 base::SequencedWorkerPool* blocking_pool_; | 244 base::SequencedWorkerPool* blocking_pool_; | 
| 243 mojo::URLResponseDiskCachePtr url_response_disk_cache_; | 245 mojo::URLResponseDiskCachePtr url_response_disk_cache_; | 
| 244 mojo::NetworkServicePtr network_service_; | 246 mojo::NetworkServicePtr network_service_; | 
| 245 mojo::NetworkServicePtr authenticating_network_service_; | 247 mojo::NetworkServicePtr authenticating_network_service_; | 
| 246 MimeTypeToURLMap mime_type_to_url_; | 248 MimeTypeToURLMap mime_type_to_url_; | 
| 247 ScopedVector<NativeRunner> native_runners_; | 249 ScopedVector<NativeRunner> native_runners_; | 
| 248 bool initialized_authentication_interceptor_; | 250 bool initialized_authentication_interceptor_; | 
| 249 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; | 251 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; | 
| 250 | 252 | 
| 251 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); | 253 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); | 
| 252 }; | 254 }; | 
| 253 | 255 | 
| 254 } // namespace shell | 256 } // namespace shell | 
| 255 | 257 | 
| 256 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 258 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 
| OLD | NEW |