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

Side by Side Diff: chrome/browser/diagnostics/sqlite_diagnostics.cc

Issue 515033: Cleanup histogram classes mixing SetFlags into FactoryGet arguments... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 12 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 | « chrome/browser/chrome_browser_application_mac_unittest.mm ('k') | chrome/browser/jankometer.cc » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "chrome/browser/diagnostics/sqlite_diagnostics.h" 5 #include "chrome/browser/diagnostics/sqlite_diagnostics.h"
6 6
7 #include "app/sql/connection.h" 7 #include "app/sql/connection.h"
8 #include "base/histogram.h" 8 #include "base/histogram.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
(...skipping 25 matching lines...) Expand all
36 sql::Statement* stmt) { 36 sql::Statement* stmt) {
37 NOTREACHED() << "sqlite error " << error; 37 NOTREACHED() << "sqlite error " << error;
38 RecordErrorInHistogram(error); 38 RecordErrorInHistogram(error);
39 return error; 39 return error;
40 } 40 }
41 41
42 private: 42 private:
43 static void RecordErrorInHistogram(int error) { 43 static void RecordErrorInHistogram(int error) {
44 // The histogram values from sqlite result codes go currently from 1 to 44 // The histogram values from sqlite result codes go currently from 1 to
45 // 26 currently but 50 gives them room to grow. 45 // 26 currently but 50 gives them room to grow.
46 static scoped_refptr<Histogram> histogram = 46 UMA_HISTOGRAM_ENUMERATION(kHistogramNames[unique], error, 50);
47 LinearHistogram::LinearHistogramFactoryGet(kHistogramNames[unique], 1,
48 50, 51);
49 histogram->SetFlags(kUmaTargetedHistogramFlag);
50 histogram->Add(error);
51 } 47 }
52 }; 48 };
53 49
54 } // namespace 50 } // namespace
55 51
56 sql::ErrorDelegate* GetErrorHandlerForCookieDb() { 52 sql::ErrorDelegate* GetErrorHandlerForCookieDb() {
57 return new BasicSqliteErrrorHandler<0>(); 53 return new BasicSqliteErrrorHandler<0>();
58 } 54 }
59 55
60 sql::ErrorDelegate* GetErrorHandlerForHistoryDb() { 56 sql::ErrorDelegate* GetErrorHandlerForHistoryDb() {
61 return new BasicSqliteErrrorHandler<1>(); 57 return new BasicSqliteErrrorHandler<1>();
62 } 58 }
63 59
64 sql::ErrorDelegate* GetErrorHandlerForThumbnailDb() { 60 sql::ErrorDelegate* GetErrorHandlerForThumbnailDb() {
65 return new BasicSqliteErrrorHandler<2>(); 61 return new BasicSqliteErrrorHandler<2>();
66 } 62 }
67 63
68 sql::ErrorDelegate* GetErrorHandlerForTextDb() { 64 sql::ErrorDelegate* GetErrorHandlerForTextDb() {
69 return new BasicSqliteErrrorHandler<3>(); 65 return new BasicSqliteErrrorHandler<3>();
70 } 66 }
71 67
72 sql::ErrorDelegate* GetErrorHandlerForWebDb() { 68 sql::ErrorDelegate* GetErrorHandlerForWebDb() {
73 return new BasicSqliteErrrorHandler<4>(); 69 return new BasicSqliteErrrorHandler<4>();
74 } 70 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_application_mac_unittest.mm ('k') | chrome/browser/jankometer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698