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

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: 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
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,
sky 2015/04/30 21:59:08 Doing it like you have here means multiple calls t
Elliot Glaysher 2015/05/01 17:00:04 I don't believe this is the case. Above, RegisterS
+ 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,

Powered by Google App Engine
This is Rietveld 408576698