| OLD | NEW |
| 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 "content/common/gpu/client/command_buffer_metrics.h" | 5 #include "content/common/gpu/client/command_buffer_metrics.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 namespace command_buffer_metrics { | 10 namespace command_buffer_metrics { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 CONTEXT_LOST_REASON_MAX_ENUM); | 110 CONTEXT_LOST_REASON_MAX_ENUM); |
| 111 break; | 111 break; |
| 112 case OFFSCREEN_CONTEXT_FOR_WEBGL: | 112 case OFFSCREEN_CONTEXT_FOR_WEBGL: |
| 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: |
| 121 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.BlimpRenderCompositor", reason, |
| 122 CONTEXT_LOST_REASON_MAX_ENUM); |
| 123 case BLIMP_RENDER_WORKER_CONTEXT: |
| 124 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.BlimpRenderWorker", reason, |
| 125 CONTEXT_LOST_REASON_MAX_ENUM); |
| 120 case CONTEXT_TYPE_UNKNOWN: | 126 case CONTEXT_TYPE_UNKNOWN: |
| 121 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.Unknown", reason, | 127 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.Unknown", reason, |
| 122 CONTEXT_LOST_REASON_MAX_ENUM); | 128 CONTEXT_LOST_REASON_MAX_ENUM); |
| 123 break; | 129 break; |
| 124 } | 130 } |
| 125 } | 131 } |
| 126 | 132 |
| 127 } // anonymous namespace | 133 } // anonymous namespace |
| 128 | 134 |
| 129 std::string ContextTypeToString(ContextType type) { | 135 std::string ContextTypeToString(ContextType type) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 143 case RENDERER_MAINTHREAD_CONTEXT: | 149 case RENDERER_MAINTHREAD_CONTEXT: |
| 144 return "Offscreen-MainThread"; | 150 return "Offscreen-MainThread"; |
| 145 case GPU_VIDEO_ACCELERATOR_CONTEXT: | 151 case GPU_VIDEO_ACCELERATOR_CONTEXT: |
| 146 return "GPU-VideoAccelerator-Offscreen"; | 152 return "GPU-VideoAccelerator-Offscreen"; |
| 147 case OFFSCREEN_VIDEO_CAPTURE_CONTEXT: | 153 case OFFSCREEN_VIDEO_CAPTURE_CONTEXT: |
| 148 return "Offscreen-CaptureThread"; | 154 return "Offscreen-CaptureThread"; |
| 149 case OFFSCREEN_CONTEXT_FOR_WEBGL: | 155 case OFFSCREEN_CONTEXT_FOR_WEBGL: |
| 150 return "Offscreen-For-WebGL"; | 156 return "Offscreen-For-WebGL"; |
| 151 case MEDIA_CONTEXT: | 157 case MEDIA_CONTEXT: |
| 152 return "Media"; | 158 return "Media"; |
| 159 case BLIMP_RENDER_COMPOSITOR_CONTEXT: |
| 160 return "BlimpRenderCompositor"; |
| 161 case BLIMP_RENDER_WORKER_CONTEXT: |
| 162 return "BlimpRenderWorker"; |
| 153 default: | 163 default: |
| 154 NOTREACHED(); | 164 NOTREACHED(); |
| 155 return "unknown"; | 165 return "unknown"; |
| 156 } | 166 } |
| 157 } | 167 } |
| 158 | 168 |
| 159 void UmaRecordContextInitFailed(ContextType type) { | 169 void UmaRecordContextInitFailed(ContextType type) { |
| 160 RecordContextLost(type, CONTEXT_INIT_FAILED); | 170 RecordContextLost(type, CONTEXT_INIT_FAILED); |
| 161 } | 171 } |
| 162 | 172 |
| 163 void UmaRecordContextLost(ContextType type, | 173 void UmaRecordContextLost(ContextType type, |
| 164 gpu::error::Error error, | 174 gpu::error::Error error, |
| 165 gpu::error::ContextLostReason reason) { | 175 gpu::error::ContextLostReason reason) { |
| 166 CommandBufferContextLostReason converted_reason = | 176 CommandBufferContextLostReason converted_reason = |
| 167 GetContextLostReason(error, reason); | 177 GetContextLostReason(error, reason); |
| 168 RecordContextLost(type, converted_reason); | 178 RecordContextLost(type, converted_reason); |
| 169 } | 179 } |
| 170 | 180 |
| 171 } // namespace command_buffer_metrics | 181 } // namespace command_buffer_metrics |
| 172 } // namespace content | 182 } // namespace content |
| OLD | NEW |