Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 2660003003: Add MediaError.message (Closed)
Patch Set: Simplify to just 1 string with no newlines: [status plus first MEDIA_ERROR_LOG_ENTRY], if any Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698