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

Unified Diff: shell/application_manager/application_manager.cc

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, 10 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: shell/application_manager/application_manager.cc
diff --git a/shell/application_manager/application_manager.cc b/shell/application_manager/application_manager.cc
index 64b7c0f9d28a3c2324f395a82fbc775dbfbeb1c3..e95ea256feb806d5fd3e156a567fec90e0c34701 100644
--- a/shell/application_manager/application_manager.cc
+++ b/shell/application_manager/application_manager.cc
@@ -86,7 +86,7 @@ bool ApplicationManager::TestAPI::HasCreatedInstance() {
}
bool ApplicationManager::TestAPI::HasFactoryForURL(const GURL& url) const {
- return manager_->url_to_shell_impl_.find(url) !=
+ return manager_->url_to_shell_impl_.find(URLAndIdentity(url)) !=
manager_->url_to_shell_impl_.end();
}
@@ -200,13 +200,13 @@ InterfaceRequest<Application> ApplicationManager::RegisterShell(
const GURL& requestor_url,
InterfaceRequest<ServiceProvider> services,
ServiceProviderPtr exposed_services) {
- GURL app_url = GetBaseURLAndQuery(resolved_url, nullptr);
+ URLAndIdentity app_url_and_identity(resolved_url);
ApplicationPtr application;
InterfaceRequest<Application> application_request = GetProxy(&application);
- ShellImpl* shell =
- new ShellImpl(application.Pass(), this, original_url, app_url);
- url_to_shell_impl_[app_url] = shell;
+ ShellImpl* shell = new ShellImpl(application.Pass(), this, original_url,
+ app_url_and_identity);
+ url_to_shell_impl_[app_url_and_identity] = shell;
shell->InitializeApplication(GetArgsForURL(original_url));
ConnectToClient(shell, resolved_url, requestor_url, services.Pass(),
exposed_services.Pass());
@@ -214,7 +214,7 @@ InterfaceRequest<Application> ApplicationManager::RegisterShell(
}
ShellImpl* ApplicationManager::GetShellImpl(const GURL& url) {
- const auto& shell_it = url_to_shell_impl_.find(url);
+ const auto& shell_it = url_to_shell_impl_.find(URLAndIdentity(url));
if (shell_it != url_to_shell_impl_.end())
return shell_it->second;
return nullptr;
@@ -338,8 +338,10 @@ void ApplicationManager::RegisterExternalApplication(
LOG(WARNING) << "--args-for provided for external application " << url
<< " <ignored>";
}
- ShellImpl* shell_impl = new ShellImpl(application.Pass(), this, url, url);
- url_to_shell_impl_[url] = shell_impl;
+ URLAndIdentity url_and_identity(url);
+ ShellImpl* shell_impl =
+ new ShellImpl(application.Pass(), this, url, url_and_identity);
+ url_to_shell_impl_[url_and_identity] = shell_impl;
shell_impl->InitializeApplication(Array<String>::From(args));
}
@@ -415,10 +417,10 @@ ApplicationLoader* ApplicationManager::GetLoaderForURL(const GURL& url) {
void ApplicationManager::OnShellImplError(ShellImpl* shell_impl) {
// Called from ~ShellImpl, so we do not need to call Destroy here.
- const GURL url = shell_impl->url();
+ const URLAndIdentity url_and_identity = shell_impl->url_and_identity();
const GURL requested_url = shell_impl->requested_url();
// Remove the shell.
- URLToShellImplMap::iterator it = url_to_shell_impl_.find(url);
+ auto it = url_to_shell_impl_.find(url_and_identity);
DCHECK(it != url_to_shell_impl_.end());
delete it->second;
url_to_shell_impl_.erase(it);

Powered by Google App Engine
This is Rietveld 408576698