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

Side by Side Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 2776853002: Make UMA_HISTOGRAM_ENUMERATION work with scoped enums. (Closed)
Patch Set: Add comments Created 3 years, 8 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/browser/gpu/gpu_data_manager_impl_private.h" 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 const base::CommandLine& command_line = 136 const base::CommandLine& command_line =
137 *base::CommandLine::ForCurrentProcess(); 137 *base::CommandLine::ForCurrentProcess();
138 bool disabled = false; 138 bool disabled = false;
139 139
140 // Use entry 0 to capture the total number of times that data 140 // Use entry 0 to capture the total number of times that data
141 // was recorded in this histogram in order to have a convenient 141 // was recorded in this histogram in order to have a convenient
142 // denominator to compute blacklist percentages for the rest of the 142 // denominator to compute blacklist percentages for the rest of the
143 // entries. 143 // entries.
144 UMA_HISTOGRAM_ENUMERATION("GPU.BlacklistTestResultsPerEntry", 144 UMA_HISTOGRAM_EXACT_LINEAR("GPU.BlacklistTestResultsPerEntry", 0,
145 0, max_entry_id + 1); 145 max_entry_id + 1);
146 146
147 if (blacklisted_features.size() != 0) { 147 if (blacklisted_features.size() != 0) {
148 std::vector<uint32_t> flag_entries; 148 std::vector<uint32_t> flag_entries;
149 blacklist->GetDecisionEntries(&flag_entries, disabled); 149 blacklist->GetDecisionEntries(&flag_entries, disabled);
150 DCHECK_GT(flag_entries.size(), 0u); 150 DCHECK_GT(flag_entries.size(), 0u);
151 for (size_t i = 0; i < flag_entries.size(); ++i) { 151 for (size_t i = 0; i < flag_entries.size(); ++i) {
152 UMA_HISTOGRAM_ENUMERATION("GPU.BlacklistTestResultsPerEntry", 152 UMA_HISTOGRAM_EXACT_LINEAR("GPU.BlacklistTestResultsPerEntry",
153 flag_entries[i], max_entry_id + 1); 153 flag_entries[i], max_entry_id + 1);
154 } 154 }
155 } 155 }
156 156
157 // This counts how many users are affected by a disabled entry - this allows 157 // This counts how many users are affected by a disabled entry - this allows
158 // us to understand the impact of an entry before enable it. 158 // us to understand the impact of an entry before enable it.
159 std::vector<uint32_t> flag_disabled_entries; 159 std::vector<uint32_t> flag_disabled_entries;
160 disabled = true; 160 disabled = true;
161 blacklist->GetDecisionEntries(&flag_disabled_entries, disabled); 161 blacklist->GetDecisionEntries(&flag_disabled_entries, disabled);
162 for (uint32_t disabled_entry : flag_disabled_entries) { 162 for (uint32_t disabled_entry : flag_disabled_entries) {
163 UMA_HISTOGRAM_ENUMERATION("GPU.BlacklistTestResultsPerDisabledEntry", 163 UMA_HISTOGRAM_EXACT_LINEAR("GPU.BlacklistTestResultsPerDisabledEntry",
164 disabled_entry, max_entry_id + 1); 164 disabled_entry, max_entry_id + 1);
165 } 165 }
166 166
167 const gpu::GpuFeatureType kGpuFeatures[] = { 167 const gpu::GpuFeatureType kGpuFeatures[] = {
168 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS, 168 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS,
169 gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING, 169 gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING,
170 gpu::GPU_FEATURE_TYPE_GPU_RASTERIZATION, 170 gpu::GPU_FEATURE_TYPE_GPU_RASTERIZATION,
171 gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL, gpu::GPU_FEATURE_TYPE_WEBGL2}; 171 gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL, gpu::GPU_FEATURE_TYPE_WEBGL2};
172 const std::string kGpuBlacklistFeatureHistogramNames[] = { 172 const std::string kGpuBlacklistFeatureHistogramNames[] = {
173 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", 173 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas",
174 "GPU.BlacklistFeatureTestResults.GpuCompositing", 174 "GPU.BlacklistFeatureTestResults.GpuCompositing",
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1362 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; 1362 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure;
1363 #if defined(OS_WIN) 1363 #if defined(OS_WIN)
1364 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; 1364 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure;
1365 #endif 1365 #endif
1366 complete_gpu_info_already_requested_ = true; 1366 complete_gpu_info_already_requested_ = true;
1367 // Some observers might be waiting. 1367 // Some observers might be waiting.
1368 NotifyGpuInfoUpdate(); 1368 NotifyGpuInfoUpdate();
1369 } 1369 }
1370 1370
1371 } // namespace content 1371 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698