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

Side by Side Diff: sql/diagnostic_error_delegate.h

Issue 9159020: Create a class to represent a DOM Storage Database. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address review comments, streamline tests and allow them to operate on in-memory databases. Created 8 years, 10 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
« no previous file with comments | « no previous file | sql/statement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SQL_DIAGNOSTIC_ERROR_DELEGATE_H_ 5 #ifndef SQL_DIAGNOSTIC_ERROR_DELEGATE_H_
6 #define SQL_DIAGNOSTIC_ERROR_DELEGATE_H_ 6 #define SQL_DIAGNOSTIC_ERROR_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 10 matching lines...) Expand all
21 // need to be singletons that is why they are always static at the function 21 // need to be singletons that is why they are always static at the function
22 // scope, but we cannot use the Singleton class because they are not default 22 // scope, but we cannot use the Singleton class because they are not default
23 // constructible. The template parameter makes the compiler to create unique 23 // constructible. The template parameter makes the compiler to create unique
24 // classes that don't share the same static variable. 24 // classes that don't share the same static variable.
25 template <class UniqueT> 25 template <class UniqueT>
26 class DiagnosticErrorDelegate : public ErrorDelegate { 26 class DiagnosticErrorDelegate : public ErrorDelegate {
27 public: 27 public:
28 28
29 virtual int OnError(int error, Connection* connection, 29 virtual int OnError(int error, Connection* connection,
30 Statement* stmt) { 30 Statement* stmt) {
31 NOTREACHED() << "sqlite error " << error 31 /* NOTREACHED() << "sqlite error " << error
32 << ", errno " << connection->GetLastErrno() 32 << ", errno " << connection->GetLastErrno()
33 << ": " << connection->GetErrorMessage(); 33 << ": " << connection->GetErrorMessage();
34 RecordErrorInHistogram(error); 34 */ RecordErrorInHistogram(error);
benm (inactive) 2012/02/06 18:19:41 d'oh, didn't mean to leave this in. This NOTREACHE
35 return error; 35 return error;
36 } 36 }
37 37
38 private: 38 private:
39 static void RecordErrorInHistogram(int error) { 39 static void RecordErrorInHistogram(int error) {
40 // Trim off the extended error codes. 40 // Trim off the extended error codes.
41 error &= 0xff; 41 error &= 0xff;
42 42
43 // The histogram values from sqlite result codes go currently from 1 to 43 // The histogram values from sqlite result codes go currently from 1 to
44 // 26 currently but 50 gives them room to grow. 44 // 26 currently but 50 gives them room to grow.
45 UMA_HISTOGRAM_ENUMERATION(UniqueT::name(), error, 50); 45 UMA_HISTOGRAM_ENUMERATION(UniqueT::name(), error, 50);
46 } 46 }
47 }; 47 };
48 48
49 } // namespace sql 49 } // namespace sql
50 50
51 #endif // SQL_DIAGNOSTIC_ERROR_DELEGATE_H_ 51 #endif // SQL_DIAGNOSTIC_ERROR_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | sql/statement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698