diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-03 23:59:14 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-03 23:59:14 +0000 |
commit | c088e3a35dcb52d62255f97307960b8ad3aaffa7 (patch) | |
tree | 4b8638a366467cbaa4915575ed47fd72b5d8a2a6 /webkit/appcache | |
parent | 8d469a234bbc0e1b59fb4d5315be697069f780c1 (diff) | |
download | chromium_src-c088e3a35dcb52d62255f97307960b8ad3aaffa7.zip chromium_src-c088e3a35dcb52d62255f97307960b8ad3aaffa7.tar.gz chromium_src-c088e3a35dcb52d62255f97307960b8ad3aaffa7.tar.bz2 |
Bake targeted error histogram support directly into sql::Connection.
Previously there was a convoluted template system to unique histogram names for purposes of tracking database errors separately. This was needed due to the static cache used by the histogram macros. Instead, just log the histogram manually without using a static cache.
Additionally, pull the histogram functionality right up into the connection, rather than requiring formalized delegation to get it.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/11474030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175055 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache')
-rw-r--r-- | webkit/appcache/appcache_database.cc | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/webkit/appcache/appcache_database.cc b/webkit/appcache/appcache_database.cc index 77a8f15..e8f4b0b 100644 --- a/webkit/appcache/appcache_database.cc +++ b/webkit/appcache/appcache_database.cc @@ -9,7 +9,6 @@ #include "base/logging.h" #include "base/utf_string_conversions.h" #include "sql/connection.h" -#include "sql/diagnostic_error_delegate.h" #include "sql/meta_table.h" #include "sql/statement.h" #include "sql/transaction.h" @@ -138,15 +137,6 @@ const IndexInfo kIndexes[] = { const int kTableCount = ARRAYSIZE_UNSAFE(kTables); const int kIndexCount = ARRAYSIZE_UNSAFE(kIndexes); -class HistogramUniquifier { - public: - static const char* name() { return "Sqlite.AppCache.Error"; } -}; - -sql::ErrorDelegate* GetErrorHandlerForAppCacheDb() { - return new sql::DiagnosticErrorDelegate<HistogramUniquifier>(); -} - bool CreateTable(sql::Connection* db, const TableInfo& info) { std::string sql("CREATE TABLE "); sql += info.table_name; @@ -972,7 +962,7 @@ bool AppCacheDatabase::LazyOpen(bool create_if_needed) { db_.reset(new sql::Connection); meta_table_.reset(new sql::MetaTable); - db_->set_error_delegate(GetErrorHandlerForAppCacheDb()); + db_->set_error_histogram_name("Sqlite.AppCache.Error"); bool opened = false; if (use_in_memory_db) { |