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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 WebMediaPlayer::NetworkState WebMediaPlayerImpl::GetNetworkState() const { | 776 WebMediaPlayer::NetworkState WebMediaPlayerImpl::GetNetworkState() const { |
777 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 777 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
778 return network_state_; | 778 return network_state_; |
779 } | 779 } |
780 | 780 |
781 WebMediaPlayer::ReadyState WebMediaPlayerImpl::GetReadyState() const { | 781 WebMediaPlayer::ReadyState WebMediaPlayerImpl::GetReadyState() const { |
782 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 782 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
783 return ready_state_; | 783 return ready_state_; |
784 } | 784 } |
785 | 785 |
786 blink::WebString WebMediaPlayerImpl::GetErrorMessage() { | 786 blink::WebString WebMediaPlayerImpl::GetErrorMessage() const { |
787 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 787 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
788 return blink::WebString::FromUTF8(media_log_->GetLastErrorMessage()); | 788 return blink::WebString::FromUTF8(media_log_->GetErrorMessage()); |
789 } | 789 } |
790 | 790 |
791 blink::WebTimeRanges WebMediaPlayerImpl::Buffered() const { | 791 blink::WebTimeRanges WebMediaPlayerImpl::Buffered() const { |
792 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 792 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
793 | 793 |
794 Ranges<base::TimeDelta> buffered_time_ranges = | 794 Ranges<base::TimeDelta> buffered_time_ranges = |
795 pipeline_controller_.GetBufferedTimeRanges(); | 795 pipeline_controller_.GetBufferedTimeRanges(); |
796 | 796 |
797 const base::TimeDelta duration = GetPipelineMediaDuration(); | 797 const base::TimeDelta duration = GetPipelineMediaDuration(); |
798 if (duration != kInfiniteDuration) { | 798 if (duration != kInfiniteDuration) { |
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2359 | 2359 |
2360 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { | 2360 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { |
2361 DCHECK(data_source_ || chunk_demuxer_); | 2361 DCHECK(data_source_ || chunk_demuxer_); |
2362 if (data_source_) | 2362 if (data_source_) |
2363 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); | 2363 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); |
2364 else | 2364 else |
2365 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); | 2365 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); |
2366 } | 2366 } |
2367 | 2367 |
2368 } // namespace media | 2368 } // namespace media |
OLD | NEW |