Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Side by Side Diff: shell/application_manager/application_manager.h

Issue 979203002: Index application by URL and identity for multiprocess. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/scoped_vector.h" 14 #include "base/memory/scoped_vector.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "mojo/public/cpp/bindings/interface_request.h" 16 #include "mojo/public/cpp/bindings/interface_request.h"
17 #include "mojo/public/interfaces/application/service_provider.mojom.h" 17 #include "mojo/public/interfaces/application/service_provider.mojom.h"
18 #include "mojo/services/network/public/interfaces/network_service.mojom.h" 18 #include "mojo/services/network/public/interfaces/network_service.mojom.h"
19 #include "shell/application_manager/application_loader.h" 19 #include "shell/application_manager/application_loader.h"
20 #include "shell/application_manager/fetcher.h" 20 #include "shell/application_manager/fetcher.h"
21 #include "shell/application_manager/shell_impl.h" 21 #include "shell/application_manager/shell_impl.h"
22 #include "shell/application_manager/url_and_identity.h"
22 #include "url/gurl.h" 23 #include "url/gurl.h"
23 24
24 namespace base { 25 namespace base {
25 class FilePath; 26 class FilePath;
26 class SequencedWorkerPool; 27 class SequencedWorkerPool;
27 } 28 }
28 29
29 namespace mojo { 30 namespace mojo {
30 namespace shell { 31 namespace shell {
31 32
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 void TerminateShellConnections(); 162 void TerminateShellConnections();
162 163
163 // Removes a ShellImpl when it encounters an error. 164 // Removes a ShellImpl when it encounters an error.
164 void OnShellImplError(ShellImpl* shell_impl); 165 void OnShellImplError(ShellImpl* shell_impl);
165 166
166 private: 167 private:
167 class ContentHandlerConnection; 168 class ContentHandlerConnection;
168 169
169 typedef std::map<std::string, ApplicationLoader*> SchemeToLoaderMap; 170 typedef std::map<std::string, ApplicationLoader*> SchemeToLoaderMap;
170 typedef std::map<GURL, ApplicationLoader*> URLToLoaderMap; 171 typedef std::map<GURL, ApplicationLoader*> URLToLoaderMap;
171 typedef std::map<GURL, ShellImpl*> URLToShellImplMap; 172 typedef std::map<URLAndIdentity, ShellImpl*> URLAndIdentityToShellImplMap;
172 typedef std::map<GURL, ContentHandlerConnection*> URLToContentHandlerMap; 173 typedef std::map<GURL, ContentHandlerConnection*> URLToContentHandlerMap;
173 typedef std::map<GURL, std::vector<std::string>> URLToArgsMap; 174 typedef std::map<GURL, std::vector<std::string>> URLToArgsMap;
174 typedef std::map<std::string, GURL> MimeTypeToURLMap; 175 typedef std::map<std::string, GURL> MimeTypeToURLMap;
175 typedef std::map<GURL, NativeRunnerFactory::Options> URLToNativeOptionsMap; 176 typedef std::map<GURL, NativeRunnerFactory::Options> URLToNativeOptionsMap;
176 177
177 bool ConnectToRunningApplication(const GURL& resolved_url, 178 bool ConnectToRunningApplication(const GURL& resolved_url,
178 const GURL& requestor_url, 179 const GURL& requestor_url,
179 InterfaceRequest<ServiceProvider>* services, 180 InterfaceRequest<ServiceProvider>* services,
180 ServiceProviderPtr* exposed_services); 181 ServiceProviderPtr* exposed_services);
181 182
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 void CleanupRunner(NativeRunner* runner); 238 void CleanupRunner(NativeRunner* runner);
238 239
239 Delegate* const delegate_; 240 Delegate* const delegate_;
240 // Loader management. 241 // Loader management.
241 // Loaders are chosen in the order they are listed here. 242 // Loaders are chosen in the order they are listed here.
242 URLToLoaderMap url_to_loader_; 243 URLToLoaderMap url_to_loader_;
243 SchemeToLoaderMap scheme_to_loader_; 244 SchemeToLoaderMap scheme_to_loader_;
244 scoped_ptr<ApplicationLoader> default_loader_; 245 scoped_ptr<ApplicationLoader> default_loader_;
245 scoped_ptr<NativeRunnerFactory> native_runner_factory_; 246 scoped_ptr<NativeRunnerFactory> native_runner_factory_;
246 247
247 URLToShellImplMap url_to_shell_impl_; 248 URLAndIdentityToShellImplMap url_to_shell_impl_;
DaveMoore 2015/03/06 17:32:08 This is no longer url_to_shell_impl_.
qsr 2015/03/09 16:22:47 Done.
248 URLToContentHandlerMap url_to_content_handler_; 249 URLToContentHandlerMap url_to_content_handler_;
249 URLToArgsMap url_to_args_; 250 URLToArgsMap url_to_args_;
250 // Note: The keys are URLs after mapping and resolving. 251 // Note: The keys are URLs after mapping and resolving.
251 URLToNativeOptionsMap url_to_native_options_; 252 URLToNativeOptionsMap url_to_native_options_;
252 253
253 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; 254 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_;
254 255
255 base::SequencedWorkerPool* blocking_pool_; 256 base::SequencedWorkerPool* blocking_pool_;
256 NetworkServicePtr network_service_; 257 NetworkServicePtr network_service_;
257 MimeTypeToURLMap mime_type_to_url_; 258 MimeTypeToURLMap mime_type_to_url_;
258 ScopedVector<NativeRunner> native_runners_; 259 ScopedVector<NativeRunner> native_runners_;
259 bool disable_cache_; 260 bool disable_cache_;
260 261
261 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); 262 DISALLOW_COPY_AND_ASSIGN(ApplicationManager);
262 }; 263 };
263 264
264 } // namespace shell 265 } // namespace shell
265 } // namespace mojo 266 } // namespace mojo
266 267
267 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ 268 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698