| 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_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 delegate_->SetIsEffectivelyFullscreen(delegate_id_, isEffectivelyFullscreen); | 387 delegate_->SetIsEffectivelyFullscreen(delegate_id_, isEffectivelyFullscreen); |
| 388 } | 388 } |
| 389 | 389 |
| 390 void WebMediaPlayerImpl::DoLoad(LoadType load_type, | 390 void WebMediaPlayerImpl::DoLoad(LoadType load_type, |
| 391 const blink::WebURL& url, | 391 const blink::WebURL& url, |
| 392 CORSMode cors_mode) { | 392 CORSMode cors_mode) { |
| 393 DVLOG(1) << __func__; | 393 DVLOG(1) << __func__; |
| 394 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 394 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 395 | 395 |
| 396 GURL gurl(url); | 396 GURL gurl(url); |
| 397 ReportMetrics(load_type, gurl, frame_->getSecurityOrigin()); | 397 ReportMetrics(load_type, gurl, frame_->getSecurityOrigin(), media_log_); |
| 398 | 398 |
| 399 // Set subresource URL for crash reporting. | 399 // Set subresource URL for crash reporting. |
| 400 base::debug::SetCrashKeyValue("subresource_url", gurl.spec()); | 400 base::debug::SetCrashKeyValue("subresource_url", gurl.spec()); |
| 401 | 401 |
| 402 if (use_fallback_path_) | 402 if (use_fallback_path_) |
| 403 fallback_url_ = gurl; | 403 fallback_url_ = gurl; |
| 404 | 404 |
| 405 load_type_ = load_type; | 405 load_type_ = load_type; |
| 406 | 406 |
| 407 SetNetworkState(WebMediaPlayer::NetworkStateLoading); | 407 SetNetworkState(WebMediaPlayer::NetworkStateLoading); |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 } | 1200 } |
| 1201 | 1201 |
| 1202 void WebMediaPlayerImpl::OnError(PipelineStatus status) { | 1202 void WebMediaPlayerImpl::OnError(PipelineStatus status) { |
| 1203 DVLOG(1) << __func__; | 1203 DVLOG(1) << __func__; |
| 1204 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1204 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1205 DCHECK_NE(status, PIPELINE_OK); | 1205 DCHECK_NE(status, PIPELINE_OK); |
| 1206 | 1206 |
| 1207 if (suppress_destruction_errors_) | 1207 if (suppress_destruction_errors_) |
| 1208 return; | 1208 return; |
| 1209 | 1209 |
| 1210 ReportPipelineError(load_type_, frame_->getSecurityOrigin(), status); | 1210 ReportPipelineError(load_type_, status, media_log_); |
| 1211 media_log_->AddEvent(media_log_->CreatePipelineErrorEvent(status)); | 1211 media_log_->AddEvent(media_log_->CreatePipelineErrorEvent(status)); |
| 1212 | 1212 |
| 1213 if (ready_state_ == WebMediaPlayer::ReadyStateHaveNothing) { | 1213 if (ready_state_ == WebMediaPlayer::ReadyStateHaveNothing) { |
| 1214 // Any error that occurs before reaching ReadyStateHaveMetadata should | 1214 // Any error that occurs before reaching ReadyStateHaveMetadata should |
| 1215 // be considered a format error. | 1215 // be considered a format error. |
| 1216 SetNetworkState(WebMediaPlayer::NetworkStateFormatError); | 1216 SetNetworkState(WebMediaPlayer::NetworkStateFormatError); |
| 1217 } else { | 1217 } else { |
| 1218 SetNetworkState(PipelineErrorToNetworkState(status)); | 1218 SetNetworkState(PipelineErrorToNetworkState(status)); |
| 1219 } | 1219 } |
| 1220 | 1220 |
| (...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2325 | 2325 |
| 2326 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { | 2326 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { |
| 2327 DCHECK(data_source_ || chunk_demuxer_); | 2327 DCHECK(data_source_ || chunk_demuxer_); |
| 2328 if (data_source_) | 2328 if (data_source_) |
| 2329 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); | 2329 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); |
| 2330 else | 2330 else |
| 2331 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); | 2331 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); |
| 2332 } | 2332 } |
| 2333 | 2333 |
| 2334 } // namespace media | 2334 } // namespace media |
| OLD | NEW |