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

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

Issue 2478573004: Convert GURL::{host,path} to GURL::{host_piece,path_piece} for ==. (Closed)
Patch Set: Created 4 years, 1 month 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: components/password_manager/core/browser/password_form_manager.cc
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc
index 919f1713356e03910906a138c9b80744fe276484..3bcdbcc7186c68bd904a8533ea89b07d858b0a4c 100644
--- a/components/password_manager/core/browser/password_form_manager.cc
+++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -251,10 +251,10 @@ PasswordFormManager::MatchResultMask PasswordFormManager::DoesManage(
// redirects to HTTPS (as in http://example.org -> https://example.org/auth).
if (!origins_match && !observed_form_.origin.SchemeIsCryptographic() &&
form.origin.SchemeIsCryptographic()) {
- const std::string& old_path = observed_form_.origin.path();
- const std::string& new_path = form.origin.path();
+ const base::StringPiece& old_path = observed_form_.origin.path_piece();
+ const base::StringPiece& new_path = form.origin.path_piece();
origins_match =
- observed_form_.origin.host() == form.origin.host() &&
+ observed_form_.origin.host_piece() == form.origin.host_piece() &&
observed_form_.origin.port() == form.origin.port() &&
base::StartsWith(new_path, old_path, base::CompareCase::SENSITIVE);
}
@@ -1188,7 +1188,8 @@ bool PasswordFormManager::IsBlacklistMatch(
}
if (observed_form_.scheme == PasswordForm::SCHEME_HTML) {
- return (blacklisted_form.origin.path() == observed_form_.origin.path()) ||
+ return (blacklisted_form.origin.path_piece() ==
+ observed_form_.origin.path_piece()) ||
(AreStringsEqualOrEmpty(blacklisted_form.submit_element,
observed_form_.submit_element) &&
AreStringsEqualOrEmpty(blacklisted_form.password_element,

Powered by Google App Engine
This is Rietveld 408576698