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

Unified Diff: mojo/shell/application_manager.cc

Issue 1115363002: mojo: Use ContentHandlers to bundle multiple Applications into a module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't leak Created 5 years, 8 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
« mojo/shell/application_manager.h ('K') | « mojo/shell/application_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/application_manager.cc
diff --git a/mojo/shell/application_manager.cc b/mojo/shell/application_manager.cc
index 3f51008dbddf2018edbd4b7147cd33f1c42d07fe..86d1ba6e300d7606ffca7c934d9704fb454d33e7 100644
--- a/mojo/shell/application_manager.cc
+++ b/mojo/shell/application_manager.cc
@@ -313,6 +313,16 @@ void ApplicationManager::HandleFetchCallback(
return;
}
+ auto redirect_iter = application_package_redirect_.find(app_url);
+ if (redirect_iter != application_package_redirect_.end()) {
+ URLResponsePtr response(URLResponse::New());
+ response->url = String::From(app_url.spec());
+ LoadWithContentHandler(redirect_iter->second,
+ request.Pass(),
+ response.Pass());
+ return;
+ }
+
// TODO(aa): Sanity check that the thing we got looks vaguely like a mojo
// application. That could either mean looking for the platform-specific dll
// header, or looking for some specific mojo signature prepended to the
@@ -370,6 +380,13 @@ void ApplicationManager::RegisterContentHandler(
mime_type_to_url_[mime_type] = content_handler_url;
}
+
+void ApplicationManager::RegisterApplicationPackageRedirect(
+ const GURL& alias,
+ const GURL& content_handler_package) {
+ application_package_redirect_[alias] = content_handler_package;
+}
+
void ApplicationManager::LoadWithContentHandler(
const GURL& content_handler_url,
InterfaceRequest<Application> application_request,
« mojo/shell/application_manager.h ('K') | « mojo/shell/application_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698