summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/protocol_manager.cc
diff options
context:
space:
mode:
authorpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-17 19:51:40 +0000
committerpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-17 19:51:40 +0000
commit682343d9f1b8db68c75ab3c4632af2022dcc5ddf (patch)
treea77d4c6b29a1972b996436ca0b07e02fdf4613b3 /chrome/browser/safe_browsing/protocol_manager.cc
parent7e40f180b28951bc84ba636d93929d0494747619 (diff)
downloadchromium_src-682343d9f1b8db68c75ab3c4632af2022dcc5ddf.zip
chromium_src-682343d9f1b8db68c75ab3c4632af2022dcc5ddf.tar.gz
chromium_src-682343d9f1b8db68c75ab3c4632af2022dcc5ddf.tar.bz2
Reduce the false positive rate for SafeBrowsing gethash requests.
This CL increases the memory consumption of the bloom filter used by the SafeBrowsing system in order to decrease the number of false positive gethash requests (gethash requests that result in an empty or 204 response from the servers). The filter size in bytes is calculated as: number_of_add_prefixes * bits_per_prefix / 8 From analysis of our histograms, users have between 250k - 330k add prefixes. 'bits_per_prefix' is hard coded to 25, which means that we expect the typical bloom filter to be between 760-1000 kB, compared to the current value of approximately 450 kB. We add histograms to track the filter size, as well as the number of gethash requests that return empty results and non-empty results. BUG=10584 (http://crbug.com/10584) Review URL: http://codereview.chromium.org/67243 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13958 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing/protocol_manager.cc')
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 1dcec49..9f3ca7e 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -196,6 +196,12 @@ void SafeBrowsingProtocolManager::OnURLFetchComplete(
std::vector<SBFullHashResult> full_hashes;
bool can_cache = false;
if (response_code == 200 || response_code == 204) {
+ // For tracking our GetHash false positive (204) rate, compared to real
+ // (200) responses.
+ if (response_code == 200)
+ UMA_HISTOGRAM_COUNTS("SB2.GetHash200", 1);
+ else
+ UMA_HISTOGRAM_COUNTS("SB2.GetHash204", 1);
can_cache = true;
gethash_error_count_ = 0;
gethash_back_off_mult_ = 1;