Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: sql/diagnostic_error_delegate.h

Issue 15104003: Remove last client of sql::DiagnosticErrorDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Convert to error callback. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sql/error_delegate_util.h » ('j') | webkit/dom_storage/dom_storage_database.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SQL_DIAGNOSTIC_ERROR_DELEGATE_H_
6 #define SQL_DIAGNOSTIC_ERROR_DELEGATE_H_
7
8 #include "base/logging.h"
9 #include "sql/connection.h"
10 #include "sql/error_delegate_util.h"
11 #include "sql/sql_export.h"
12
13 namespace sql {
14
15 // This class handles the exceptional sqlite errors that we might encounter
16 // if for example the db is corrupted. Right now we just generate a UMA
17 // histogram for release and an assert for debug builds.
18 // See error_delegate_util.h for an explanation as to why this class is a
19 // template.
20 template <class UniqueT>
21 class DiagnosticErrorDelegate : public ErrorDelegate {
22 public:
23 DiagnosticErrorDelegate() {}
24 virtual ~DiagnosticErrorDelegate() {}
25
26 virtual int OnError(int error, Connection* connection,
27 Statement* stmt) {
28 LogAndRecordErrorInHistogram<UniqueT>(error, connection);
29 return error;
30 }
31
32 private:
33 DISALLOW_COPY_AND_ASSIGN(DiagnosticErrorDelegate);
34 };
35
36 } // namespace sql
37
38 #endif // SQL_DIAGNOSTIC_ERROR_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | sql/error_delegate_util.h » ('j') | webkit/dom_storage/dom_storage_database.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698