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

Unified Diff: components/safe_browsing/password_protection/password_protection_request.cc

Issue 2911293003: Reland: Cache protected password entry and password on focus ping separately. (Closed)
Patch Set: nit Created 3 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
Index: components/safe_browsing/password_protection/password_protection_request.cc
diff --git a/components/safe_browsing/password_protection/password_protection_request.cc b/components/safe_browsing/password_protection/password_protection_request.cc
index 0f74a1eebb88878ad158cdf0eb0d0ca9049bd7da..471d954c1027ae401256893279f83dc170ef2dac 100644
--- a/components/safe_browsing/password_protection/password_protection_request.cc
+++ b/components/safe_browsing/password_protection/password_protection_request.cc
@@ -38,6 +38,8 @@ PasswordProtectionRequest::PasswordProtectionRequest(
request_timeout_in_ms_(request_timeout_in_ms),
weakptr_factory_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ DCHECK(request_type_ == LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE ||
+ request_type_ == LoginReputationClientRequest::PASSWORD_REUSE_EVENT);
}
PasswordProtectionRequest::~PasswordProtectionRequest() {
@@ -81,7 +83,7 @@ void PasswordProtectionRequest::CheckCachedVerdicts() {
std::unique_ptr<LoginReputationClientResponse> cached_response =
base::MakeUnique<LoginReputationClientResponse>();
auto verdict = password_protection_service_->GetCachedVerdict(
- main_frame_url_, cached_response.get());
+ main_frame_url_, request_type(), cached_response.get());
lpz 2017/06/08 15:18:33 nit: request_type_ for consistency with the rest o
Jialiu Lin 2017/06/08 20:47:30 Done.
if (verdict != LoginReputationClientResponse::VERDICT_TYPE_UNSPECIFIED)
Finish(PasswordProtectionService::RESPONSE_ALREADY_CACHED,
std::move(cached_response));
@@ -96,7 +98,7 @@ void PasswordProtectionRequest::FillRequestProto() {
password_protection_service_->FillUserPopulation(request_type_,
request_proto_.get());
request_proto_->set_stored_verdict_cnt(
- password_protection_service_->GetStoredVerdictCount());
+ password_protection_service_->GetStoredVerdictCount(request_type_));
LoginReputationClientRequest::Frame* main_frame =
request_proto_->add_frames();
main_frame->set_url(main_frame_url_.spec());

Powered by Google App Engine
This is Rietveld 408576698