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

Unified Diff: mojo/shell/application_manager.cc

Issue 1229903003: Mandoline: Implement basic "process per site" support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nit Created 5 years, 5 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/services/network/url_loader_impl.cc ('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 4602a68ad78860d45eaefb60270d9e4394e18c02..2371158263aced74b142af586d139e40a13f9216 100644
--- a/mojo/shell/application_manager.cc
+++ b/mojo/shell/application_manager.cc
@@ -290,22 +290,32 @@ void ApplicationManager::HandleFetchCallback(
RegisterShell(app_url, qualifier, requestor_url, services.Pass(),
exposed_services.Pass(), on_application_end));
+ // For resources that are loaded with content handlers, we group app instances
+ // by site.
+
// If the response begins with a #!mojo <content-handler-url>, use it.
GURL content_handler_url;
std::string shebang;
+ bool enable_multi_process = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableMultiprocess);
+
if (fetcher->PeekContentHandler(&shebang, &content_handler_url)) {
- LoadWithContentHandler(
- content_handler_url, requestor_url, qualifier, request.Pass(),
- fetcher->AsURLResponse(blocking_pool_,
- static_cast<int>(shebang.size())));
+ URLResponsePtr response(fetcher->AsURLResponse(
+ blocking_pool_, static_cast<int>(shebang.size())));
+ std::string site =
+ enable_multi_process ? response->site.To<std::string>() : std::string();
+ LoadWithContentHandler(content_handler_url, requestor_url, site,
+ request.Pass(), response.Pass());
return;
}
MimeTypeToURLMap::iterator iter = mime_type_to_url_.find(fetcher->MimeType());
if (iter != mime_type_to_url_.end()) {
- LoadWithContentHandler(iter->second, requestor_url, qualifier,
- request.Pass(),
- fetcher->AsURLResponse(blocking_pool_, 0));
+ URLResponsePtr response(fetcher->AsURLResponse(blocking_pool_, 0));
+ std::string site =
+ enable_multi_process ? response->site.To<std::string>() : std::string();
+ LoadWithContentHandler(iter->second, requestor_url, site, request.Pass(),
+ response.Pass());
return;
}
« no previous file with comments | « mojo/services/network/url_loader_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698