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

Unified Diff: chrome/browser/extensions/extension_webrequest_api.cc

Issue 9120011: Use GURL::Replacements to trim query and ref from URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_webrequest_api.cc
diff --git a/chrome/browser/extensions/extension_webrequest_api.cc b/chrome/browser/extensions/extension_webrequest_api.cc
index efdb1f31dfcbd3cf86259152ceebe6e0bf7d73a1..d8c74a11671840cbae5020c978ce0a18f1235a04 100644
--- a/chrome/browser/extensions/extension_webrequest_api.cc
+++ b/chrome/browser/extensions/extension_webrequest_api.cc
@@ -146,10 +146,12 @@ bool IsSensitiveURL(const GURL& url) {
bool is_google_com_chrome_url =
EndsWith(url.host(), "google.com", true) &&
StartsWithASCII(url.path(), "/chrome", true);
- std::string url_without_query =
- url.spec().substr(0, url.spec().find_first_of('?'));
+ GURL::Replacements replacements;
+ replacements.ClearQuery();
+ replacements.ClearRef();
+ GURL url_without_query = url.ReplaceComponents(replacements);
return is_webstore_gallery_url || is_google_com_chrome_url ||
- extension_urls::IsWebstoreUpdateUrl(GURL(url_without_query)) ||
+ extension_urls::IsWebstoreUpdateUrl(url_without_query) ||
extension_urls::IsBlacklistUpdateUrl(url);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698