| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/safe_browsing/password_protection/password_protection_servi
ce.h" | 5 #include "components/safe_browsing/password_protection/password_protection_servi
ce.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 url_key, GURL(), CONTENT_SETTINGS_TYPE_PASSWORD_PROTECTION, | 351 url_key, GURL(), CONTENT_SETTINGS_TYPE_PASSWORD_PROTECTION, |
| 352 std::string(), nullptr)); | 352 std::string(), nullptr)); |
| 353 | 353 |
| 354 // Move on if we have no cached verdict for this deleted history row. | 354 // Move on if we have no cached verdict for this deleted history row. |
| 355 if (!verdict_dictionary.get() || verdict_dictionary->empty()) | 355 if (!verdict_dictionary.get() || verdict_dictionary->empty()) |
| 356 continue; | 356 continue; |
| 357 | 357 |
| 358 int verdict_count = static_cast<int>(verdict_dictionary->size()); | 358 int verdict_count = static_cast<int>(verdict_dictionary->size()); |
| 359 stored_verdict_count_ = GetStoredVerdictCount() - verdict_count; | 359 stored_verdict_count_ = GetStoredVerdictCount() - verdict_count; |
| 360 content_settings_->ClearSettingsForOneTypeWithPredicate( | 360 content_settings_->ClearSettingsForOneTypeWithPredicate( |
| 361 CONTENT_SETTINGS_TYPE_PASSWORD_PROTECTION, | 361 CONTENT_SETTINGS_TYPE_PASSWORD_PROTECTION, base::Time(), |
| 362 base::Bind(&OriginMatchPrimaryPattern, url_key)); | 362 base::Bind(&OriginMatchPrimaryPattern, url_key)); |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 | 365 |
| 366 // static | 366 // static |
| 367 bool PasswordProtectionService::ParseVerdictEntry( | 367 bool PasswordProtectionService::ParseVerdictEntry( |
| 368 base::DictionaryValue* verdict_entry, | 368 base::DictionaryValue* verdict_entry, |
| 369 int* out_verdict_received_time, | 369 int* out_verdict_received_time, |
| 370 LoginReputationClientResponse* out_verdict) { | 370 LoginReputationClientResponse* out_verdict) { |
| 371 base::Value* binary_value = nullptr; | 371 base::Value* binary_value = nullptr; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 const std::vector<char> verdict_blob(serialized_proto.begin(), | 447 const std::vector<char> verdict_blob(serialized_proto.begin(), |
| 448 serialized_proto.end()); | 448 serialized_proto.end()); |
| 449 std::unique_ptr<base::Value> binary_value = | 449 std::unique_ptr<base::Value> binary_value = |
| 450 base::MakeUnique<base::Value>(verdict_blob); | 450 base::MakeUnique<base::Value>(verdict_blob); |
| 451 DCHECK_EQ(base::Value::Type::BINARY, binary_value->type()); | 451 DCHECK_EQ(base::Value::Type::BINARY, binary_value->type()); |
| 452 result->Set(kVerdictProto, std::move(binary_value)); | 452 result->Set(kVerdictProto, std::move(binary_value)); |
| 453 return result; | 453 return result; |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace safe_browsing | 456 } // namespace safe_browsing |
| OLD | NEW |