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

Unified Diff: mojo/shell/application_manager.h

Issue 1350023002: Revert of Extract some stuff into PackageManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/shell/application_fetcher.h ('k') | mojo/shell/application_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/application_manager.h
diff --git a/mojo/shell/application_manager.h b/mojo/shell/application_manager.h
index 0ec2a6e8c9642cbea258cf15679e0cbe40f92ef6..b0c742faec0da4fcdb536f2d6f42ff4690a931e6 100644
--- a/mojo/shell/application_manager.h
+++ b/mojo/shell/application_manager.h
@@ -33,7 +33,7 @@
namespace mojo {
namespace shell {
-class PackageManager;
+class ApplicationFetcher;
class ApplicationInstance;
class ContentHandlerConnection;
@@ -55,7 +55,7 @@
DISALLOW_COPY_AND_ASSIGN(TestAPI);
};
- explicit ApplicationManager(scoped_ptr<PackageManager> package_manager);
+ explicit ApplicationManager(scoped_ptr<ApplicationFetcher> fetcher);
~ApplicationManager();
// Loads a service if necessary and establishes a new client connection.
@@ -86,6 +86,19 @@
ptr->Bind(InterfacePtrInfo<Interface>(service_handle.Pass(), 0u));
}
+ void RegisterContentHandler(const std::string& mime_type,
+ const GURL& content_handler_url);
+
+ // Registers a package alias. When attempting to load |alias|, it will
+ // instead redirect to |content_handler_package|, which is a content handler
+ // which will be passed the |alias| as the URLResponse::url. Different values
+ // of |alias| with the same |qualifier| that are in the same
+ // |content_handler_package| will run in the same process in multi-process
+ // mode.
+ void RegisterApplicationPackageAlias(const GURL& alias,
+ const GURL& content_handler_package,
+ const std::string& qualifier);
+
// Sets the default Loader to be used if not overridden by SetLoaderForURL().
void set_default_loader(scoped_ptr<ApplicationLoader> loader) {
default_loader_ = loader.Pass();
@@ -115,8 +128,10 @@
ApplicationInstance* GetApplicationInstance(const Identity& identity) const;
private:
+ using ApplicationPackagedAlias = std::map<GURL, std::pair<GURL, std::string>>;
using IdentityToApplicationInstanceMap =
std::map<Identity, ApplicationInstance*>;
+ using MimeTypeToURLMap = std::map<std::string, GURL>;
using URLToContentHandlerMap =
std::map<std::pair<GURL, std::string>, ContentHandlerConnection*>;
using URLToLoaderMap = std::map<GURL, ApplicationLoader*>;
@@ -170,18 +185,20 @@
const GURL& application_url,
const std::string& interface_name);
- scoped_ptr<PackageManager> const package_manager_;
+ scoped_ptr<ApplicationFetcher> const fetcher_;
// Loader management.
// Loaders are chosen in the order they are listed here.
URLToLoaderMap url_to_loader_;
scoped_ptr<ApplicationLoader> default_loader_;
scoped_ptr<NativeRunnerFactory> native_runner_factory_;
+ ApplicationPackagedAlias application_package_alias_;
IdentityToApplicationInstanceMap identity_to_instance_;
URLToContentHandlerMap url_to_content_handler_;
base::SequencedWorkerPool* blocking_pool_;
updater::UpdaterPtr updater_;
+ MimeTypeToURLMap mime_type_to_url_;
ScopedVector<NativeRunner> native_runners_;
// Counter used to assign ids to content_handlers.
uint32_t content_handler_id_counter_;
« no previous file with comments | « mojo/shell/application_fetcher.h ('k') | mojo/shell/application_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698