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

Unified Diff: chrome/common/safe_browsing/file_type_policies.cc

Issue 1986403002: Component updater for FileTypePolicies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@replace_download_ext
Patch Set: Fix test's enum check Created 4 years, 7 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: chrome/common/safe_browsing/file_type_policies.cc
diff --git a/chrome/common/safe_browsing/file_type_policies.cc b/chrome/common/safe_browsing/file_type_policies.cc
index cf9e4418b853e13033686b366b4c2f5e1300d471..1741b5a88de3e1ab7ba2d6fc3879bbca939b9460 100644
--- a/chrome/common/safe_browsing/file_type_policies.cc
+++ b/chrome/common/safe_browsing/file_type_policies.cc
@@ -112,6 +112,11 @@ FileTypePolicies::UpdateResult FileTypePolicies::PopulateFromBinaryPb(
// Compare against existing config, if we have one.
if (config_) {
+ // If versions are equal, we skip the update but it's not really
+ // a failure.
+ if (new_config->version_id() == config_->version_id())
+ return UpdateResult::SKIPPED_VERSION_CHECK_EQUAL;
+
// Check that version number increases
if (new_config->version_id() <= config_->version_id())
return UpdateResult::FAILED_VERSION_CHECK;
« no previous file with comments | « chrome/common/safe_browsing/file_type_policies.h ('k') | chrome/common/safe_browsing/file_type_policies_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698