summaryrefslogtreecommitdiffstats
path: root/sql
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-23 21:45:53 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-23 21:45:53 +0000
commit7bb70e64214d11bb897c50ed4e5eeeda8de29578 (patch)
tree9492ec8f9eaf2520ef928f784b4b3c727db39cb5 /sql
parent194cfcf377509bf977fc0302d3e4a026a95b7e53 (diff)
downloadchromium_src-7bb70e64214d11bb897c50ed4e5eeeda8de29578.zip
chromium_src-7bb70e64214d11bb897c50ed4e5eeeda8de29578.tar.gz
chromium_src-7bb70e64214d11bb897c50ed4e5eeeda8de29578.tar.bz2
Remove last client of sql::DiagnosticErrorDelegate.
In the first pass, there was a problem with histograms. I do not recall what the problem was, so removing things. BUG=none Review URL: https://chromiumcodereview.appspot.com/15104003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201895 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql')
-rw-r--r--sql/diagnostic_error_delegate.h38
-rw-r--r--sql/error_delegate_util.h23
-rw-r--r--sql/sql.gyp1
3 files changed, 0 insertions, 62 deletions
diff --git a/sql/diagnostic_error_delegate.h b/sql/diagnostic_error_delegate.h
deleted file mode 100644
index 78b3d9d..0000000
--- a/sql/diagnostic_error_delegate.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef SQL_DIAGNOSTIC_ERROR_DELEGATE_H_
-#define SQL_DIAGNOSTIC_ERROR_DELEGATE_H_
-
-#include "base/logging.h"
-#include "sql/connection.h"
-#include "sql/error_delegate_util.h"
-#include "sql/sql_export.h"
-
-namespace sql {
-
-// This class handles the exceptional sqlite errors that we might encounter
-// if for example the db is corrupted. Right now we just generate a UMA
-// histogram for release and an assert for debug builds.
-// See error_delegate_util.h for an explanation as to why this class is a
-// template.
-template <class UniqueT>
-class DiagnosticErrorDelegate : public ErrorDelegate {
- public:
- DiagnosticErrorDelegate() {}
- virtual ~DiagnosticErrorDelegate() {}
-
- virtual int OnError(int error, Connection* connection,
- Statement* stmt) {
- LogAndRecordErrorInHistogram<UniqueT>(error, connection);
- return error;
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DiagnosticErrorDelegate);
-};
-
-} // namespace sql
-
-#endif // SQL_DIAGNOSTIC_ERROR_DELEGATE_H_
diff --git a/sql/error_delegate_util.h b/sql/error_delegate_util.h
index 6b90ccf..0c67c07 100644
--- a/sql/error_delegate_util.h
+++ b/sql/error_delegate_util.h
@@ -5,8 +5,6 @@
#ifndef SQL_ERROR_DELEGATE_UTIL_H_
#define SQL_ERROR_DELEGATE_UTIL_H_
-#include "base/metrics/histogram.h"
-#include "sql/connection.h"
#include "sql/sql_export.h"
namespace sql {
@@ -15,27 +13,6 @@ namespace sql {
// |error|.
SQL_EXPORT bool IsErrorCatastrophic(int error);
-// Log error in console in debug mode and generate a UMA histogram in release
-// mode for |error| for |UniqueT::name()|.
-// This function is templated because histograms need to be singletons. That is
-// why they are always static at the function scope. The template parameter
-// makes the compiler create unique functions that don't share the same static
-// variable.
-template <class UniqueT>
-void LogAndRecordErrorInHistogram(int error,
- sql::Connection* connection) {
- LOG(ERROR) << "sqlite error " << error
- << ", errno " << connection->GetLastErrno()
- << ": " << connection->GetErrorMessage();
-
- // Trim off the extended error codes.
- error &= 0xff;
-
- // The histogram values from sqlite result codes currently go from 1 to 26
- // but 50 gives them room to grow.
- UMA_HISTOGRAM_ENUMERATION(UniqueT::name(), error, 50);
-}
-
} // namespace sql
#endif // SQL_ERROR_DELEGATE_UTIL_H_
diff --git a/sql/sql.gyp b/sql/sql.gyp
index 0d8f8be..86cfbc9 100644
--- a/sql/sql.gyp
+++ b/sql/sql.gyp
@@ -18,7 +18,6 @@
'sources': [
'connection.cc',
'connection.h',
- 'diagnostic_error_delegate.h',
'error_delegate_util.cc',
'error_delegate_util.h',
'init_status.h',