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

Side by Side Diff: services/ui/public/cpp/gpu/command_buffer_metrics.cc

Issue 2586323002: mus: Use ui::ContextProviderCommandBuffer. (Closed)
Patch Set: . Created 4 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
« no previous file with comments | « services/ui/public/cpp/gpu/command_buffer_metrics.h ('k') | services/ui/public/cpp/gpu/gpu.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "services/ui/public/cpp/gpu/command_buffer_metrics.h" 5 #include "services/ui/public/cpp/gpu/command_buffer_metrics.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 8
9 namespace ui { 9 namespace ui {
10 namespace command_buffer_metrics { 10 namespace command_buffer_metrics {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.WebGL", reason, 113 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.WebGL", reason,
114 CONTEXT_LOST_REASON_MAX_ENUM); 114 CONTEXT_LOST_REASON_MAX_ENUM);
115 break; 115 break;
116 case MEDIA_CONTEXT: 116 case MEDIA_CONTEXT:
117 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.Media", reason, 117 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.Media", reason,
118 CONTEXT_LOST_REASON_MAX_ENUM); 118 CONTEXT_LOST_REASON_MAX_ENUM);
119 break; 119 break;
120 case BLIMP_RENDER_COMPOSITOR_CONTEXT: 120 case BLIMP_RENDER_COMPOSITOR_CONTEXT:
121 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.BlimpRenderCompositor", reason, 121 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.BlimpRenderCompositor", reason,
122 CONTEXT_LOST_REASON_MAX_ENUM); 122 CONTEXT_LOST_REASON_MAX_ENUM);
123 break;
123 case BLIMP_RENDER_WORKER_CONTEXT: 124 case BLIMP_RENDER_WORKER_CONTEXT:
124 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.BlimpRenderWorker", reason, 125 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.BlimpRenderWorker", reason,
125 CONTEXT_LOST_REASON_MAX_ENUM); 126 CONTEXT_LOST_REASON_MAX_ENUM);
127 break;
128 case MUS_CLIENT_CONTEXT:
129 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.MusClient", reason,
130 CONTEXT_LOST_REASON_MAX_ENUM);
131 break;
126 case CONTEXT_TYPE_UNKNOWN: 132 case CONTEXT_TYPE_UNKNOWN:
127 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.Unknown", reason, 133 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.Unknown", reason,
128 CONTEXT_LOST_REASON_MAX_ENUM); 134 CONTEXT_LOST_REASON_MAX_ENUM);
129 break; 135 break;
130 } 136 }
131 } 137 }
132 138
133 } // anonymous namespace 139 } // anonymous namespace
134 140
135 std::string ContextTypeToString(ContextType type) { 141 std::string ContextTypeToString(ContextType type) {
(...skipping 17 matching lines...) Expand all
153 case OFFSCREEN_VIDEO_CAPTURE_CONTEXT: 159 case OFFSCREEN_VIDEO_CAPTURE_CONTEXT:
154 return "Offscreen-CaptureThread"; 160 return "Offscreen-CaptureThread";
155 case OFFSCREEN_CONTEXT_FOR_WEBGL: 161 case OFFSCREEN_CONTEXT_FOR_WEBGL:
156 return "Offscreen-For-WebGL"; 162 return "Offscreen-For-WebGL";
157 case MEDIA_CONTEXT: 163 case MEDIA_CONTEXT:
158 return "Media"; 164 return "Media";
159 case BLIMP_RENDER_COMPOSITOR_CONTEXT: 165 case BLIMP_RENDER_COMPOSITOR_CONTEXT:
160 return "BlimpRenderCompositor"; 166 return "BlimpRenderCompositor";
161 case BLIMP_RENDER_WORKER_CONTEXT: 167 case BLIMP_RENDER_WORKER_CONTEXT:
162 return "BlimpRenderWorker"; 168 return "BlimpRenderWorker";
169 case MUS_CLIENT_CONTEXT:
170 return "MusClientContext";
163 default: 171 default:
164 NOTREACHED(); 172 NOTREACHED();
165 return "unknown"; 173 return "unknown";
166 } 174 }
167 } 175 }
168 176
169 void UmaRecordContextInitFailed(ContextType type) { 177 void UmaRecordContextInitFailed(ContextType type) {
170 RecordContextLost(type, CONTEXT_INIT_FAILED); 178 RecordContextLost(type, CONTEXT_INIT_FAILED);
171 } 179 }
172 180
173 void UmaRecordContextLost(ContextType type, 181 void UmaRecordContextLost(ContextType type,
174 gpu::error::Error error, 182 gpu::error::Error error,
175 gpu::error::ContextLostReason reason) { 183 gpu::error::ContextLostReason reason) {
176 CommandBufferContextLostReason converted_reason = 184 CommandBufferContextLostReason converted_reason =
177 GetContextLostReason(error, reason); 185 GetContextLostReason(error, reason);
178 RecordContextLost(type, converted_reason); 186 RecordContextLost(type, converted_reason);
179 } 187 }
180 188
181 } // namespace command_buffer_metrics 189 } // namespace command_buffer_metrics
182 } // namespace ui 190 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/gpu/command_buffer_metrics.h ('k') | services/ui/public/cpp/gpu/gpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698