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

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

Issue 815363002: replace COMPILE_ASSERT with static_assert in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 6 years 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/diagnostics_metrics.h" 5 #include "chrome/browser/diagnostics/diagnostics_metrics.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 {"SQLiteIntegrityCookie", "Cookie database"}, 46 {"SQLiteIntegrityCookie", "Cookie database"},
47 {"SQLiteIntegrityDatabaseTracker", "Database tracker database"}, 47 {"SQLiteIntegrityDatabaseTracker", "Database tracker database"},
48 {"SQLiteIntegrityHistory", "History database"}, 48 {"SQLiteIntegrityHistory", "History database"},
49 {"SQLiteIntegrityNSSCert", "NSS certificate database"}, 49 {"SQLiteIntegrityNSSCert", "NSS certificate database"},
50 {"SQLiteIntegrityNSSKey", "NSS Key database"}, 50 {"SQLiteIntegrityNSSKey", "NSS Key database"},
51 {"SQLiteIntegrityThumbnails", "Thumbnails database"}, 51 {"SQLiteIntegrityThumbnails", "Thumbnails database"},
52 {"SQLiteIntegrityWebData", "Web Data database"}, 52 {"SQLiteIntegrityWebData", "Web Data database"},
53 // Add new entries in the same order as DiagnosticsTestId. 53 // Add new entries in the same order as DiagnosticsTestId.
54 }; 54 };
55 55
56 COMPILE_ASSERT(arraysize(kTestNameInfo) == DIAGNOSTICS_TEST_ID_COUNT, 56 static_assert(arraysize(kTestNameInfo) == DIAGNOSTICS_TEST_ID_COUNT,
57 diagnostics_test_info_mismatch); 57 "diagnostics test info mismatch");
58 58
59 const TestNameInfo* FindTestInfo(DiagnosticsTestId id) { 59 const TestNameInfo* FindTestInfo(DiagnosticsTestId id) {
60 DCHECK(id < DIAGNOSTICS_TEST_ID_COUNT); 60 DCHECK(id < DIAGNOSTICS_TEST_ID_COUNT);
61 return &kTestNameInfo[id]; 61 return &kTestNameInfo[id];
62 } 62 }
63 63
64 } // namespace 64 } // namespace
65 65
66 std::string GetTestName(DiagnosticsTestId id) { 66 std::string GetTestName(DiagnosticsTestId id) {
67 return std::string(FindTestInfo(id)->name); 67 return std::string(FindTestInfo(id)->name);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 switch (id) { 119 switch (id) {
120 TEST_CASES(name); // See above 120 TEST_CASES(name); // See above
121 default: 121 default:
122 NOTREACHED() << "Unhandled UMA Metric type" << id; 122 NOTREACHED() << "Unhandled UMA Metric type" << id;
123 } 123 }
124 } 124 }
125 #undef TEST_CASE 125 #undef TEST_CASE
126 #undef TEST_CASES 126 #undef TEST_CASES
127 127
128 } // namespace diagnostics 128 } // namespace diagnostics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698