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

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

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan 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 7ae0096a48124c08fdf07d016fd1be684170af68..0c60a60f3fa59172bcb23aef8e7021ee41a4dc6a 100644
--- a/components/password_manager/core/browser/password_form_manager.cc
+++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -148,7 +148,7 @@ PasswordFormManager::PasswordFormManager(
PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES),
form_path_segments_(
observed_form_.origin.is_valid()
- ? SplitPathToSegments(observed_form_.origin.path())
+ ? SplitPathToSegments(observed_form_.origin.path().as_string())
: std::vector<std::string>()),
is_new_login_(true),
has_generated_password_(false),
@@ -236,8 +236,8 @@ 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 base::StringPiece& old_path = observed_form_.origin.path_piece();
- const base::StringPiece& new_path = form.origin.path_piece();
+ const base::StringPiece& old_path = observed_form_.origin.path();
+ const base::StringPiece& new_path = form.origin.path();
origins_match =
observed_form_.origin.host_piece() == form.origin.host_piece() &&
observed_form_.origin.port() == form.origin.port() &&
@@ -1121,7 +1121,7 @@ uint32_t PasswordFormManager::ScoreResult(const PasswordForm& candidate) const {
// Walk the origin URL paths one directory at a time to see how
// deep the two match.
std::vector<std::string> candidate_path_segments =
- SplitPathToSegments(candidate.origin.path());
+ SplitPathToSegments(candidate.origin.path().as_string());
size_t depth = 0u;
const size_t max_dirs = std::min(capped_form_path_segment_count,
candidate_path_segments.size());
« no previous file with comments | « components/omnibox/browser/builtin_provider.cc ('k') | components/plugins/renderer/mobile_youtube_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698