diff options
Diffstat (limited to 'chrome/browser/safe_browsing')
3 files changed, 16 insertions, 7 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc index 76b40db..d649dcb 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database.cc @@ -171,10 +171,12 @@ SafeBrowsingDatabase* SafeBrowsingDatabase::Create() { return new SafeBrowsingDatabaseNew(new SafeBrowsingStoreFile); } else if (!value.compare("newsqlite")) { return new SafeBrowsingDatabaseNew(new SafeBrowsingStoreSqlite); - } else { - DCHECK(value.empty() || !value.compare("old")); - // Default to the old implementation. + } else if (!value.compare("old")) { return new SafeBrowsingDatabaseBloom; + } else { + // Default. + DCHECK(value.empty()); + return new SafeBrowsingDatabaseNew(new SafeBrowsingStoreSqlite); } } @@ -620,9 +622,6 @@ void SafeBrowsingDatabaseNew::UpdateFinished(bool update_succeeded) { << bloom_gen.InMilliseconds() << " ms total. prefix count: "<< add_prefixes.size(); UMA_HISTOGRAM_LONG_TIMES("SB2.BuildFilter", bloom_gen); - UMA_HISTOGRAM_COUNTS("SB2.AddPrefixes", add_prefixes.size()); - // TODO(shess): Push this line into |store_|? Or ignore? - // UMA_HISTOGRAM_COUNTS("SB2.SubPrefixes", subs); UMA_HISTOGRAM_COUNTS("SB2.FilterSize", bloom_filter_->size()); int64 size_64; if (file_util::GetFileSize(filename_, &size_64)) diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file.cc b/chrome/browser/safe_browsing/safe_browsing_store_file.cc index 31a4337..de3d7ee 100644 --- a/chrome/browser/safe_browsing/safe_browsing_store_file.cc +++ b/chrome/browser/safe_browsing/safe_browsing_store_file.cc @@ -5,6 +5,7 @@ #include "chrome/browser/safe_browsing/safe_browsing_store_file.h" #include "base/callback.h" +#include "base/histogram.h" #include "base/md5.h" // TODO(shess): Remove after migration. @@ -522,6 +523,10 @@ bool SafeBrowsingStoreFile::DoUpdate( if (!file_util::Move(new_filename, filename_)) return false; + // Record counts before swapping to caller. + UMA_HISTOGRAM_COUNTS("SB2.AddPrefixes", add_prefixes.size()); + UMA_HISTOGRAM_COUNTS("SB2.SubPrefixes", sub_prefixes.size()); + // Pass the resulting data off to the caller. add_prefixes_result->swap(add_prefixes); add_full_hashes_result->swap(add_full_hashes); diff --git a/chrome/browser/safe_browsing/safe_browsing_store_sqlite.cc b/chrome/browser/safe_browsing/safe_browsing_store_sqlite.cc index b312f15..12b281b 100644 --- a/chrome/browser/safe_browsing/safe_browsing_store_sqlite.cc +++ b/chrome/browser/safe_browsing/safe_browsing_store_sqlite.cc @@ -8,6 +8,7 @@ #include "base/callback.h" #include "base/file_util.h" +#include "base/histogram.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/common/sqlite_compiled_statement.h" @@ -629,10 +630,14 @@ bool SafeBrowsingStoreSqlite::DoUpdate( int rv = insert_transaction_->Commit(); if (rv != SQLITE_OK) { NOTREACHED() << "SafeBrowsing update transaction failed to commit."; - // UMA_HISTOGRAM_COUNTS("SB2.FailedUpdate", 1); + UMA_HISTOGRAM_COUNTS("SB2.FailedUpdate", 1); return false; } + // Record counts before swapping to caller. + UMA_HISTOGRAM_COUNTS("SB2.AddPrefixes", add_prefixes.size()); + UMA_HISTOGRAM_COUNTS("SB2.SubPrefixes", sub_prefixes.size()); + add_prefixes_result->swap(add_prefixes); add_full_hashes_result->swap(add_full_hashes); |