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

Unified Diff: components/autofill/content/browser/wallet/wallet_service_url.cc

Issue 1220653002: Fix some case-insensitive cases for StartsWith (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: grt's review comments, Mac fix Created 5 years, 6 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 | « chrome/installer/util/shell_util_unittest.cc ('k') | components/autofill/content/renderer/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/browser/wallet/wallet_service_url.cc
diff --git a/components/autofill/content/browser/wallet/wallet_service_url.cc b/components/autofill/content/browser/wallet/wallet_service_url.cc
index e032ed3e29607ea1d1a0fa734a7b5835c593885e..68cbd8f4f1f9115614f044125d0b64ef107ff5db 100644
--- a/components/autofill/content/browser/wallet/wallet_service_url.cc
+++ b/components/autofill/content/browser/wallet/wallet_service_url.cc
@@ -206,9 +206,11 @@ bool IsSignInContinueUrl(const GURL& url, size_t* user_index) {
bool IsSignInRelatedUrl(const GURL& url) {
size_t unused;
- return url.GetOrigin() == GetAddAccountUrl().GetOrigin() ||
- base::StartsWith(base::UTF8ToUTF16(url.GetOrigin().host()),
- base::ASCIIToUTF16("accounts."), false) ||
+ // Origins are host names which are canonicalized, so case-sensitive is OK.
+ GURL origin = url.GetOrigin();
+ return origin == GetAddAccountUrl().GetOrigin() ||
+ base::StartsWith(origin.host(), "accounts.",
+ base::CompareCase::SENSITIVE) ||
IsSignInContinueUrl(url, &unused);
}
« no previous file with comments | « chrome/installer/util/shell_util_unittest.cc ('k') | components/autofill/content/renderer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698