| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 CONTEXT_LOST_REASON_MAX_ENUM); | 105 CONTEXT_LOST_REASON_MAX_ENUM); |
| 106 break; | 106 break; |
| 107 case OFFSCREEN_VIDEO_CAPTURE_CONTEXT: | 107 case OFFSCREEN_VIDEO_CAPTURE_CONTEXT: |
| 108 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.VideoCapture", reason, | 108 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.VideoCapture", reason, |
| 109 CONTEXT_LOST_REASON_MAX_ENUM); | 109 CONTEXT_LOST_REASON_MAX_ENUM); |
| 110 break; | 110 break; |
| 111 case OFFSCREEN_CONTEXT_FOR_WEBGL: | 111 case OFFSCREEN_CONTEXT_FOR_WEBGL: |
| 112 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.WebGL", reason, | 112 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.WebGL", reason, |
| 113 CONTEXT_LOST_REASON_MAX_ENUM); | 113 CONTEXT_LOST_REASON_MAX_ENUM); |
| 114 break; | 114 break; |
| 115 case MEDIA_CONTEXT: |
| 116 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.Media", reason, |
| 117 CONTEXT_LOST_REASON_MAX_ENUM); |
| 118 break; |
| 115 case CONTEXT_TYPE_UNKNOWN: | 119 case CONTEXT_TYPE_UNKNOWN: |
| 116 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.Unknown", reason, | 120 UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.Unknown", reason, |
| 117 CONTEXT_LOST_REASON_MAX_ENUM); | 121 CONTEXT_LOST_REASON_MAX_ENUM); |
| 118 break; | 122 break; |
| 119 } | 123 } |
| 120 } | 124 } |
| 121 | 125 |
| 122 } // anonymous namespace | 126 } // anonymous namespace |
| 123 | 127 |
| 124 std::string ContextTypeToString(ContextType type) { | 128 std::string ContextTypeToString(ContextType type) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 136 case RENDER_WORKER_CONTEXT: | 140 case RENDER_WORKER_CONTEXT: |
| 137 return "RenderWorker"; | 141 return "RenderWorker"; |
| 138 case RENDERER_MAINTHREAD_CONTEXT: | 142 case RENDERER_MAINTHREAD_CONTEXT: |
| 139 return "Offscreen-MainThread"; | 143 return "Offscreen-MainThread"; |
| 140 case GPU_VIDEO_ACCELERATOR_CONTEXT: | 144 case GPU_VIDEO_ACCELERATOR_CONTEXT: |
| 141 return "GPU-VideoAccelerator-Offscreen"; | 145 return "GPU-VideoAccelerator-Offscreen"; |
| 142 case OFFSCREEN_VIDEO_CAPTURE_CONTEXT: | 146 case OFFSCREEN_VIDEO_CAPTURE_CONTEXT: |
| 143 return "Offscreen-CaptureThread"; | 147 return "Offscreen-CaptureThread"; |
| 144 case OFFSCREEN_CONTEXT_FOR_WEBGL: | 148 case OFFSCREEN_CONTEXT_FOR_WEBGL: |
| 145 return "Offscreen-For-WebGL"; | 149 return "Offscreen-For-WebGL"; |
| 150 case MEDIA_CONTEXT: |
| 151 return "Media"; |
| 146 default: | 152 default: |
| 147 NOTREACHED(); | 153 NOTREACHED(); |
| 148 return "unknown"; | 154 return "unknown"; |
| 149 } | 155 } |
| 150 } | 156 } |
| 151 | 157 |
| 152 void UmaRecordContextInitFailed(ContextType type) { | 158 void UmaRecordContextInitFailed(ContextType type) { |
| 153 RecordContextLost(type, CONTEXT_INIT_FAILED); | 159 RecordContextLost(type, CONTEXT_INIT_FAILED); |
| 154 } | 160 } |
| 155 | 161 |
| 156 void UmaRecordContextLost(ContextType type, | 162 void UmaRecordContextLost(ContextType type, |
| 157 gpu::error::Error error, | 163 gpu::error::Error error, |
| 158 gpu::error::ContextLostReason reason) { | 164 gpu::error::ContextLostReason reason) { |
| 159 CommandBufferContextLostReason converted_reason = | 165 CommandBufferContextLostReason converted_reason = |
| 160 GetContextLostReason(error, reason); | 166 GetContextLostReason(error, reason); |
| 161 RecordContextLost(type, converted_reason); | 167 RecordContextLost(type, converted_reason); |
| 162 } | 168 } |
| 163 | 169 |
| 164 } // namespace command_buffer_metrics | 170 } // namespace command_buffer_metrics |
| 165 } // namespace content | 171 } // namespace content |
| OLD | NEW |