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

Unified Diff: components/password_manager/core/browser/psl_matching_helper.cc

Issue 779183003: LoginDatabase should allow retrieveing credentials with IP addresses (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 6 years 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 | « components/password_manager/core/browser/login_database_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/psl_matching_helper.cc
diff --git a/components/password_manager/core/browser/psl_matching_helper.cc b/components/password_manager/core/browser/psl_matching_helper.cc
index b2fcdbae01e8ddae60e7a63fdad3dffe179299b2..2f7f9d6f76de76cc751bc364823e3159aa4ca00b 100644
--- a/components/password_manager/core/browser/psl_matching_helper.cc
+++ b/components/password_manager/core/browser/psl_matching_helper.cc
@@ -18,7 +18,8 @@ namespace password_manager {
bool ShouldPSLDomainMatchingApply(
const std::string& registry_controlled_domain) {
- return registry_controlled_domain != "google.com";
+ return !registry_controlled_domain.empty() &&
+ registry_controlled_domain != "google.com";
}
bool IsPublicSuffixDomainMatch(const std::string& url1,
@@ -29,6 +30,9 @@ bool IsPublicSuffixDomainMatch(const std::string& url1,
if (!gurl1.is_valid() || !gurl2.is_valid())
return false;
+ if (gurl1 == gurl2)
+ return true;
+
std::string domain1(GetRegistryControlledDomain(gurl1));
std::string domain2(GetRegistryControlledDomain(gurl2));
« no previous file with comments | « components/password_manager/core/browser/login_database_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698