Please review the following:
- @dru...@chromium.org: c*
- @daniel...@google.com: ios
@anu...@chromium.org cc fyi for context for downstream CLs
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
// Don't expect cache results for eeee and ffff, since they are not in theI think this comment is a better fit for its original location, since it explains the block of EXPECT_TRUE/EXPECT_FALSE?
ClearExpiredResultsHelper(cache);I'm not sure this helper function is doing anything useful? It just calls ClearExpiredResults, which is the original code
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Don't expect cache results for eeee and ffff, since they are not in theI think this comment is a better fit for its original location, since it explains the block of EXPECT_TRUE/EXPECT_FALSE?
Oops, thanks!
ClearExpiredResultsHelper(cache);I'm not sure this helper function is doing anything useful? It just calls ClearExpiredResults, which is the original code
This one is because `ClearExpiredResults` is private now that the VerdictCacheManager usage is within the cache class, and the test class is friended so moving it to a method within the test class lets the test call that (instead of friending all the individual test cases).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
21 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: components/safe_browsing/core/browser/db/v5_search_hashes_cache_unittest.cc
Insertions: 2, Deletions: 2.
@@ -164,13 +164,13 @@
EXPECT_TRUE(cache->SearchCache({"eeee", "ffff"}).empty());
CheckAndResetCacheHitsAndMisses(/*num_hits=*/0, /*num_misses=*/2);
- // Don't expect cache results for eeee and ffff, since they are not in the
- // cache. Expect cache results for all other prefixes.
std::set<std::string> hash_prefixes_to_search = {"aaaa", "bbbb", "cccc",
"dddd", "eeee", "ffff"};
auto cache_results = cache->SearchCache(hash_prefixes_to_search);
CheckAndResetCacheHitsAndMisses(/*num_hits=*/4, /*num_misses=*/2);
+ // Don't expect cache results for eeee and ffff, since they are not in the
+ // cache. Expect cache results for all other prefixes.
EXPECT_EQ(cache_results.size(), 4u);
EXPECT_TRUE(cache_results.contains("aaaa"));
EXPECT_TRUE(cache_results.contains("bbbb"));
```
Create V5SearchHashesCache from HashRealTimeCache
The newer v5 API will start to be used by local checks (HPD) instead of
just hash-prefix real-time (HPRT) checks. Since eventually the two
mechanisms hit the same v5 SearchHashes endpoint, they will both share
the same local cache per profile.
This CL creates the V5SearchHashesCache mostly copied directly from the
existing HashRealTimeCache. For now, its factory creates it in all of
the same scenarios that the only consumer (HashRealTimeService) was
creating it.
Specifically, this CL:
1. Removes the HPRT cache from VerdictCacheManager and recreates it as
its own V5SearchHashesCache class.
2. Creates the chrome and ios factories for V5SearchHashesCache.
3. Makes HashRealTimeService dependent on the new V5SearchHashesCache
instead of on VerdictCacheManager.
4. Copies over the main caching code from HashRealTimeCache to the new
V5SearchHashesCache.
5. Copies over the logic to clear expired entries from the cache every
30 minutes from VerdictCacheManager to V5SearchHashesCache.
6. Copies over the artificial URL caching logic from VerdictCacheManager
to V5SearchHashesCache.
7. Does some renaming for HPRT-related things to note V5SearchHashes
instead. Some will be done in downstream CLs instead.
8. Improves iOS tests in SafeBrowsingServiceTest which were previously
not fully checking whether HPRT was returned the right verdict.
Note that the behavior of the cache remains HPRT-focused for now. Later
CLs will broaden the focus.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |