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

Unified Diff: shell/application_manager/application_manager.cc

Issue 982903002: Shell: Strip query string from URL when looking to apply native options. (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
« no previous file with comments | « shell/application_manager/application_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/application_manager/application_manager.cc
diff --git a/shell/application_manager/application_manager.cc b/shell/application_manager/application_manager.cc
index 11f875945dee83c6c999cfa50efee9d24e62ed28..90df84643b641f2a7683e13feefc413b7ef0aecf 100644
--- a/shell/application_manager/application_manager.cc
+++ b/shell/application_manager/application_manager.cc
@@ -288,12 +288,13 @@ void ApplicationManager::HandleFetchCallback(
// library.
// TODO(vtl): (Maybe this should be done by the factory/runner?)
+ GURL base_resolved_url = GetBaseURLAndQuery(fetcher->GetURL(), nullptr);
NativeRunnerFactory::Options options;
- if (url_to_native_options_.find(fetcher->GetURL()) !=
+ if (url_to_native_options_.find(base_resolved_url) !=
url_to_native_options_.end()) {
DVLOG(2) << "Applying stored native options to resolved URL "
<< fetcher->GetURL() << " (requested URL " << requested_url << ")";
- options = url_to_native_options_[fetcher->GetURL()];
+ options = url_to_native_options_[base_resolved_url];
}
fetcher->AsPath(
@@ -393,8 +394,10 @@ void ApplicationManager::SetArgsForURL(const std::vector<std::string>& args,
void ApplicationManager::SetNativeOptionsForURL(
const NativeRunnerFactory::Options& options,
const GURL& url) {
+ DCHECK(!url.has_query()); // Precondition.
// Apply mappings and resolution to get the resolved URL.
GURL resolved_url = delegate_->ResolveURL(delegate_->ResolveMappings(url));
+ DCHECK(!resolved_url.has_query()); // Still shouldn't have query.
// TODO(vtl): We should probably also remove/disregard the query string (and
// maybe canonicalize in other ways).
DVLOG(2) << "Storing native options for resolved URL " << resolved_url
« no previous file with comments | « shell/application_manager/application_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698