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

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: rebase 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 140
141 const base::CommandLine& command_line = 141 const base::CommandLine& command_line =
142 *base::CommandLine::ForCurrentProcess(); 142 *base::CommandLine::ForCurrentProcess();
143 bool disabled = false; 143 bool disabled = false;
144 144
145 // Use entry 0 to capture the total number of times that data 145 // Use entry 0 to capture the total number of times that data
146 // was recorded in this histogram in order to have a convenient 146 // was recorded in this histogram in order to have a convenient
147 // denominator to compute blacklist percentages for the rest of the 147 // denominator to compute blacklist percentages for the rest of the
148 // entries. 148 // entries.
149 UMA_HISTOGRAM_ENUMERATION("GPU.BlacklistTestResultsPerEntry", 149 UMA_HISTOGRAM_EXACT_LINEAR("GPU.BlacklistTestResultsPerEntry", 0,
150 0, max_entry_id + 1); 150 max_entry_id + 1);
151 151
152 if (blacklisted_features.size() != 0) { 152 if (blacklisted_features.size() != 0) {
153 std::vector<uint32_t> flag_entries; 153 std::vector<uint32_t> flag_entries;
154 blacklist->GetDecisionEntries(&flag_entries, disabled); 154 blacklist->GetDecisionEntries(&flag_entries, disabled);
155 DCHECK_GT(flag_entries.size(), 0u); 155 DCHECK_GT(flag_entries.size(), 0u);
156 for (size_t i = 0; i < flag_entries.size(); ++i) { 156 for (size_t i = 0; i < flag_entries.size(); ++i) {
157 UMA_HISTOGRAM_ENUMERATION("GPU.BlacklistTestResultsPerEntry", 157 UMA_HISTOGRAM_EXACT_LINEAR("GPU.BlacklistTestResultsPerEntry",
158 flag_entries[i], max_entry_id + 1); 158 flag_entries[i], max_entry_id + 1);
159 } 159 }
160 } 160 }
161 161
162 // This counts how many users are affected by a disabled entry - this allows 162 // This counts how many users are affected by a disabled entry - this allows
163 // us to understand the impact of an entry before enable it. 163 // us to understand the impact of an entry before enable it.
164 std::vector<uint32_t> flag_disabled_entries; 164 std::vector<uint32_t> flag_disabled_entries;
165 disabled = true; 165 disabled = true;
166 blacklist->GetDecisionEntries(&flag_disabled_entries, disabled); 166 blacklist->GetDecisionEntries(&flag_disabled_entries, disabled);
167 for (uint32_t disabled_entry : flag_disabled_entries) { 167 for (uint32_t disabled_entry : flag_disabled_entries) {
168 UMA_HISTOGRAM_ENUMERATION("GPU.BlacklistTestResultsPerDisabledEntry", 168 UMA_HISTOGRAM_EXACT_LINEAR("GPU.BlacklistTestResultsPerDisabledEntry",
169 disabled_entry, max_entry_id + 1); 169 disabled_entry, max_entry_id + 1);
170 } 170 }
171 171
172 const gpu::GpuFeatureType kGpuFeatures[] = { 172 const gpu::GpuFeatureType kGpuFeatures[] = {
173 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS, 173 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS,
174 gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING, 174 gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING,
175 gpu::GPU_FEATURE_TYPE_GPU_RASTERIZATION, 175 gpu::GPU_FEATURE_TYPE_GPU_RASTERIZATION,
176 gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL, gpu::GPU_FEATURE_TYPE_WEBGL2}; 176 gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL, gpu::GPU_FEATURE_TYPE_WEBGL2};
177 const std::string kGpuBlacklistFeatureHistogramNames[] = { 177 const std::string kGpuBlacklistFeatureHistogramNames[] = {
178 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", 178 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas",
179 "GPU.BlacklistFeatureTestResults.GpuCompositing", 179 "GPU.BlacklistFeatureTestResults.GpuCompositing",
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; 1392 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure;
1393 #if defined(OS_WIN) 1393 #if defined(OS_WIN)
1394 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; 1394 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure;
1395 #endif 1395 #endif
1396 complete_gpu_info_already_requested_ = true; 1396 complete_gpu_info_already_requested_ = true;
1397 // Some observers might be waiting. 1397 // Some observers might be waiting.
1398 NotifyGpuInfoUpdate(); 1398 NotifyGpuInfoUpdate();
1399 } 1399 }
1400 1400
1401 } // namespace content 1401 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698