Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "media/blink/webmediaplayer_util.h" | 5 #include "media/blink/webmediaplayer_util.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 GetMediaClient()->RecordRapporURL("Media.OriginUrl.MSE.Secure", | 132 GetMediaClient()->RecordRapporURL("Media.OriginUrl.MSE.Secure", |
| 133 security_origin_url); | 133 security_origin_url); |
| 134 } else { | 134 } else { |
| 135 GetMediaClient()->RecordRapporURL("Media.OriginUrl.MSE.Insecure", | 135 GetMediaClient()->RecordRapporURL("Media.OriginUrl.MSE.Insecure", |
| 136 security_origin_url); | 136 security_origin_url); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 | 141 |
| 142 void ReportPipelineError(blink::WebMediaPlayer::LoadType load_type, | |
| 143 const blink::WebSecurityOrigin& security_origin, | |
| 144 PipelineStatus error) { | |
| 145 DCHECK_NE(PIPELINE_OK, error); | |
| 146 | |
| 147 // Report the origin from where the media player is created. | |
| 148 if (!GetMediaClient()) | |
| 149 return; | |
| 150 | |
| 151 GetMediaClient()->RecordRapporURL( | |
| 152 "Media.OriginUrl." + LoadTypeToString(load_type) + "PipelineError", | |
| 153 blink::WebStringToGURL(security_origin.toString())); | |
|
Ilya Sherman
2016/04/29 20:25:30
Hmm, would it make sense to just have a single met
| |
| 154 } | |
| 155 | |
| 142 void RecordOriginOfHLSPlayback(const GURL& origin_url) { | 156 void RecordOriginOfHLSPlayback(const GURL& origin_url) { |
| 143 if (media::GetMediaClient()) | 157 if (media::GetMediaClient()) |
| 144 GetMediaClient()->RecordRapporURL("Media.OriginUrl.HLS", origin_url); | 158 GetMediaClient()->RecordRapporURL("Media.OriginUrl.HLS", origin_url); |
| 145 } | 159 } |
| 146 | 160 |
| 147 EmeInitDataType ConvertToEmeInitDataType( | 161 EmeInitDataType ConvertToEmeInitDataType( |
| 148 blink::WebEncryptedMediaInitDataType init_data_type) { | 162 blink::WebEncryptedMediaInitDataType init_data_type) { |
| 149 switch (init_data_type) { | 163 switch (init_data_type) { |
| 150 case blink::WebEncryptedMediaInitDataType::Webm: | 164 case blink::WebEncryptedMediaInitDataType::Webm: |
| 151 return EmeInitDataType::WEBM; | 165 return EmeInitDataType::WEBM; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 | 249 |
| 236 } // namespace | 250 } // namespace |
| 237 | 251 |
| 238 OutputDeviceStatusCB ConvertToOutputDeviceStatusCB( | 252 OutputDeviceStatusCB ConvertToOutputDeviceStatusCB( |
| 239 blink::WebSetSinkIdCallbacks* web_callbacks) { | 253 blink::WebSetSinkIdCallbacks* web_callbacks) { |
| 240 return media::BindToCurrentLoop( | 254 return media::BindToCurrentLoop( |
| 241 base::Bind(RunSetSinkIdCallback, SetSinkIdCallback(web_callbacks))); | 255 base::Bind(RunSetSinkIdCallback, SetSinkIdCallback(web_callbacks))); |
| 242 } | 256 } |
| 243 | 257 |
| 244 } // namespace media | 258 } // namespace media |
| OLD | NEW |