[safe-browsing] Database full hash matches like prefix match.
commit2504fd251af18ea8d3c10e4db5d3b2b31f6556a7
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 1 May 2014 08:56:49 +0000 (1 08:56 +0000)
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 1 May 2014 08:56:49 +0000 (1 08:56 +0000)
tree261c035a7e8cca90a684aeb56a827e6d88309322
parentdff9bf6630fde412f380eb2a0b60d95964862c69
[safe-browsing] Database full hash matches like prefix match.

The safe-browsing code incorrectly replicates full-hashes into the
prefix set, and treats database full hashes as a form of cached
response.  Move the database full hashes into PrefixSet in preparation
for removing the replication.  Treat full-hash matches and prefix
matches the same (as matches which may lead to a gethash request).
ContainsBrowseUrl() full hash result changed to indicate that it is
previously-cached results.

Add a unit test that a full hash is persisted by PrefixSet.  Right now
it succeeds because of the replication of full-hash prefixes into the
prefix set.

BUG=361248,172527

Review URL: https://codereview.chromium.org/257383006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267498 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/safe_browsing/database_manager.cc
chrome/browser/safe_browsing/prefix_set.cc
chrome/browser/safe_browsing/prefix_set.h
chrome/browser/safe_browsing/prefix_set_unittest.cc
chrome/browser/safe_browsing/safe_browsing_database.cc
chrome/browser/safe_browsing/safe_browsing_database.h
chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
chrome/browser/safe_browsing/safe_browsing_store_file_unittest.cc
chrome/browser/safe_browsing/safe_browsing_util.h
chrome/browser/safe_browsing/safe_browsing_util_unittest.cc