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

Unified Diff: chrome/browser/safe_browsing/client_side_detection_service.h

Issue 7465101: Check that all the hashes ids in the model are valid. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Address Matt's comments. Created 9 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/client_side_detection_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/client_side_detection_service.h
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.h b/chrome/browser/safe_browsing/client_side_detection_service.h
index ee182d724d06a6c07c2f0121ac4e14f2a97f34c2..864ab7677b06913e1c11b79cfebd5b5f8c2f46f4 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service.h
+++ b/chrome/browser/safe_browsing/client_side_detection_service.h
@@ -130,6 +130,7 @@ class ClientSideDetectionService : public URLFetcher::Delegate,
MODEL_PARSE_ERROR,
MODEL_MISSING_FIELDS,
MODEL_INVALID_VERSION_NUMBER,
+ MODEL_BAD_HASH_IDS,
MODEL_STATUS_MAX // Always add new values before this one.
};
@@ -148,6 +149,8 @@ class ClientSideDetectionService : public URLFetcher::Delegate,
FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, FetchModelTest);
FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, SetBadSubnets);
FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, IsBadIpAddress);
+ FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest,
+ ModelHasValidHashIds);
// CacheState holds all information necessary to respond to a caller without
// actually making a HTTP request.
@@ -224,6 +227,11 @@ class ClientSideDetectionService : public URLFetcher::Delegate,
static void SetBadSubnets(const ClientSideModel& model,
BadSubnetMap* bad_subnets);
+
+ // Returns true iff all the hash id's in the client-side model point to
+ // valid hashes in the model.
+ static bool ModelHasValidHashIds(const ClientSideModel& model);
+
std::string model_str_;
scoped_ptr<ClientSideModel> model_;
scoped_ptr<base::TimeDelta> model_max_age_;
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/client_side_detection_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698