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

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

Issue 2160963002: Add watch time metrics for HTML5 media playback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only log watch time once. Created 4 years, 4 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 19 matching lines...) Expand all
30 #include "media/audio/null_audio_sink.h" 30 #include "media/audio/null_audio_sink.h"
31 #include "media/base/bind_to_current_loop.h" 31 #include "media/base/bind_to_current_loop.h"
32 #include "media/base/cdm_context.h" 32 #include "media/base/cdm_context.h"
33 #include "media/base/limits.h" 33 #include "media/base/limits.h"
34 #include "media/base/media_log.h" 34 #include "media/base/media_log.h"
35 #include "media/base/media_switches.h" 35 #include "media/base/media_switches.h"
36 #include "media/base/text_renderer.h" 36 #include "media/base/text_renderer.h"
37 #include "media/base/timestamp_constants.h" 37 #include "media/base/timestamp_constants.h"
38 #include "media/base/video_frame.h" 38 #include "media/base/video_frame.h"
39 #include "media/blink/texttrack_impl.h" 39 #include "media/blink/texttrack_impl.h"
40 #include "media/blink/watch_time_reporter.h"
40 #include "media/blink/webaudiosourceprovider_impl.h" 41 #include "media/blink/webaudiosourceprovider_impl.h"
41 #include "media/blink/webcontentdecryptionmodule_impl.h" 42 #include "media/blink/webcontentdecryptionmodule_impl.h"
42 #include "media/blink/webinbandtexttrack_impl.h" 43 #include "media/blink/webinbandtexttrack_impl.h"
43 #include "media/blink/webmediaplayer_delegate.h" 44 #include "media/blink/webmediaplayer_delegate.h"
44 #include "media/blink/webmediaplayer_util.h" 45 #include "media/blink/webmediaplayer_util.h"
45 #include "media/blink/webmediasource_impl.h" 46 #include "media/blink/webmediasource_impl.h"
46 #include "media/filters/chunk_demuxer.h" 47 #include "media/filters/chunk_demuxer.h"
47 #include "media/filters/ffmpeg_demuxer.h" 48 #include "media/filters/ffmpeg_demuxer.h"
48 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h" 49 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h"
49 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" 50 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 DCHECK_EQ(state > blink::WebMediaPlayer::NetworkStateLoaded, result); 127 DCHECK_EQ(state > blink::WebMediaPlayer::NetworkStateLoaded, result);
127 return result; 128 return result;
128 } 129 }
129 130
130 gfx::Size GetRotatedVideoSize(VideoRotation rotation, gfx::Size natural_size) { 131 gfx::Size GetRotatedVideoSize(VideoRotation rotation, gfx::Size natural_size) {
131 if (rotation == VIDEO_ROTATION_90 || rotation == VIDEO_ROTATION_270) 132 if (rotation == VIDEO_ROTATION_90 || rotation == VIDEO_ROTATION_270)
132 return gfx::Size(natural_size.height(), natural_size.width()); 133 return gfx::Size(natural_size.height(), natural_size.width());
133 return natural_size; 134 return natural_size;
134 } 135 }
135 136
137 base::TimeDelta GetCurrentTimeInternal(WebMediaPlayerImpl* p_this) {
138 // We wrap currentTime() instead of using pipeline_.GetMediaTime() since there
139 // are a variety of cases in which that time is not accurate; e.g., while
140 // remoting and during a pause or seek.
141 return base::TimeDelta::FromSecondsD(p_this->currentTime());
142 }
143
136 } // namespace 144 } // namespace
137 145
138 class BufferedDataSourceHostImpl; 146 class BufferedDataSourceHostImpl;
139 147
140 STATIC_ASSERT_ENUM(WebMediaPlayer::CORSModeUnspecified, 148 STATIC_ASSERT_ENUM(WebMediaPlayer::CORSModeUnspecified,
141 UrlData::CORS_UNSPECIFIED); 149 UrlData::CORS_UNSPECIFIED);
142 STATIC_ASSERT_ENUM(WebMediaPlayer::CORSModeAnonymous, UrlData::CORS_ANONYMOUS); 150 STATIC_ASSERT_ENUM(WebMediaPlayer::CORSModeAnonymous, UrlData::CORS_ANONYMOUS);
143 STATIC_ASSERT_ENUM(WebMediaPlayer::CORSModeUseCredentials, 151 STATIC_ASSERT_ENUM(WebMediaPlayer::CORSModeUseCredentials,
144 UrlData::CORS_USE_CREDENTIALS); 152 UrlData::CORS_USE_CREDENTIALS);
145 153
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 is_cdm_attached_(false), 218 is_cdm_attached_(false),
211 #if defined(OS_ANDROID) // WMPI_CAST 219 #if defined(OS_ANDROID) // WMPI_CAST
212 cast_impl_(this, client_, params.context_3d_cb()), 220 cast_impl_(this, client_, params.context_3d_cb()),
213 #endif 221 #endif
214 volume_(1.0), 222 volume_(1.0),
215 volume_multiplier_(1.0), 223 volume_multiplier_(1.0),
216 renderer_factory_(std::move(renderer_factory)), 224 renderer_factory_(std::move(renderer_factory)),
217 surface_manager_(params.surface_manager()), 225 surface_manager_(params.surface_manager()),
218 overlay_surface_id_(SurfaceManager::kNoSurfaceID), 226 overlay_surface_id_(SurfaceManager::kNoSurfaceID),
219 suppress_destruction_errors_(false), 227 suppress_destruction_errors_(false),
220 can_suspend_state_(CanSuspendState::UNKNOWN) { 228 can_suspend_state_(CanSuspendState::UNKNOWN),
229 is_encrypted_(false) {
221 DCHECK(!adjust_allocated_memory_cb_.is_null()); 230 DCHECK(!adjust_allocated_memory_cb_.is_null());
222 DCHECK(renderer_factory_); 231 DCHECK(renderer_factory_);
223 DCHECK(client_); 232 DCHECK(client_);
224 233
225 force_video_overlays_ = base::CommandLine::ForCurrentProcess()->HasSwitch( 234 force_video_overlays_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
226 switches::kForceVideoOverlays); 235 switches::kForceVideoOverlays);
227 236
228 if (delegate_) 237 if (delegate_)
229 delegate_id_ = delegate_->AddObserver(this); 238 delegate_id_ = delegate_->AddObserver(this);
230 239
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 return; 399 return;
391 } 400 }
392 #endif 401 #endif
393 paused_ = false; 402 paused_ = false;
394 is_idle_ = false; 403 is_idle_ = false;
395 pipeline_.SetPlaybackRate(playback_rate_); 404 pipeline_.SetPlaybackRate(playback_rate_);
396 405
397 if (data_source_) 406 if (data_source_)
398 data_source_->MediaIsPlaying(); 407 data_source_->MediaIsPlaying();
399 408
409 watch_time_reporter_->OnPlaying();
400 media_log_->AddEvent(media_log_->CreateEvent(MediaLogEvent::PLAY)); 410 media_log_->AddEvent(media_log_->CreateEvent(MediaLogEvent::PLAY));
401 UpdatePlayState(); 411 UpdatePlayState();
402 } 412 }
403 413
404 void WebMediaPlayerImpl::pause() { 414 void WebMediaPlayerImpl::pause() {
405 DVLOG(1) << __func__; 415 DVLOG(1) << __func__;
406 DCHECK(main_task_runner_->BelongsToCurrentThread()); 416 DCHECK(main_task_runner_->BelongsToCurrentThread());
407 417
408 // We update the paused state even when casting, since we expect pause() to be 418 // We update the paused state even when casting, since we expect pause() to be
409 // called when casting begins, and when we exit casting we should end up in a 419 // called when casting begins, and when we exit casting we should end up in a
410 // paused state. 420 // paused state.
411 paused_ = true; 421 paused_ = true;
412 422
413 #if defined(OS_ANDROID) // WMPI_CAST 423 #if defined(OS_ANDROID) // WMPI_CAST
414 if (isRemote()) { 424 if (isRemote()) {
415 cast_impl_.pause(); 425 cast_impl_.pause();
416 return; 426 return;
417 } 427 }
418 #endif 428 #endif
419 429
420 pipeline_.SetPlaybackRate(0.0); 430 pipeline_.SetPlaybackRate(0.0);
421 431
422 // pause() may be called after playback has ended and the HTMLMediaElement 432 // pause() may be called after playback has ended and the HTMLMediaElement
423 // requires that currentTime() == duration() after ending. We want to ensure 433 // requires that currentTime() == duration() after ending. We want to ensure
424 // |paused_time_| matches currentTime() in this case or a future seek() may 434 // |paused_time_| matches currentTime() in this case or a future seek() may
425 // incorrectly discard what it thinks is a seek to the existing time. 435 // incorrectly discard what it thinks is a seek to the existing time.
426 paused_time_ = 436 paused_time_ =
427 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); 437 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime();
428 438
439 watch_time_reporter_->OnPaused();
429 media_log_->AddEvent(media_log_->CreateEvent(MediaLogEvent::PAUSE)); 440 media_log_->AddEvent(media_log_->CreateEvent(MediaLogEvent::PAUSE));
430 UpdatePlayState(); 441 UpdatePlayState();
431 } 442 }
432 443
433 bool WebMediaPlayerImpl::supportsSave() const { 444 bool WebMediaPlayerImpl::supportsSave() const {
434 DCHECK(main_task_runner_->BelongsToCurrentThread()); 445 DCHECK(main_task_runner_->BelongsToCurrentThread());
435 return supports_save_; 446 return supports_save_;
436 } 447 }
437 448
438 void WebMediaPlayerImpl::seek(double seconds) { 449 void WebMediaPlayerImpl::seek(double seconds) {
(...skipping 30 matching lines...) Expand all
469 // completed just by restoring it. Otherwise we will just wait for the real 480 // completed just by restoring it. Otherwise we will just wait for the real
470 // ready state change to eventually happen. 481 // ready state change to eventually happen.
471 if (old_state == ReadyStateHaveEnoughData) { 482 if (old_state == ReadyStateHaveEnoughData) {
472 main_task_runner_->PostTask( 483 main_task_runner_->PostTask(
473 FROM_HERE, base::Bind(&WebMediaPlayerImpl::OnBufferingStateChange, 484 FROM_HERE, base::Bind(&WebMediaPlayerImpl::OnBufferingStateChange,
474 AsWeakPtr(), BUFFERING_HAVE_ENOUGH)); 485 AsWeakPtr(), BUFFERING_HAVE_ENOUGH));
475 } 486 }
476 return; 487 return;
477 } 488 }
478 489
490 // Call this before setting |seeking_| so that the current media time can be
491 // recorded by the reporter.
492 watch_time_reporter_->OnSeeking();
493
479 // TODO(sandersd): Ideally we would not clear the idle state if 494 // TODO(sandersd): Ideally we would not clear the idle state if
480 // |pipeline_controller_| can elide the seek. 495 // |pipeline_controller_| can elide the seek.
481 is_idle_ = false; 496 is_idle_ = false;
482 ended_ = false; 497 ended_ = false;
483 498
484 seeking_ = true; 499 seeking_ = true;
485 seek_time_ = time; 500 seek_time_ = time;
486 if (paused_) 501 if (paused_)
487 paused_time_ = time; 502 paused_time_ = time;
488 pipeline_controller_.Seek(time, time_updated); 503 pipeline_controller_.Seek(time, time_updated);
(...skipping 26 matching lines...) Expand all
515 if (data_source_) 530 if (data_source_)
516 data_source_->MediaPlaybackRateChanged(rate); 531 data_source_->MediaPlaybackRateChanged(rate);
517 } 532 }
518 } 533 }
519 534
520 void WebMediaPlayerImpl::setVolume(double volume) { 535 void WebMediaPlayerImpl::setVolume(double volume) {
521 DVLOG(1) << __func__ << "(" << volume << ")"; 536 DVLOG(1) << __func__ << "(" << volume << ")";
522 DCHECK(main_task_runner_->BelongsToCurrentThread()); 537 DCHECK(main_task_runner_->BelongsToCurrentThread());
523 volume_ = volume; 538 volume_ = volume;
524 pipeline_.SetVolume(volume_ * volume_multiplier_); 539 pipeline_.SetVolume(volume_ * volume_multiplier_);
540 if (watch_time_reporter_)
541 watch_time_reporter_->OnVolumeChange(volume);
525 } 542 }
526 543
527 void WebMediaPlayerImpl::setSinkId( 544 void WebMediaPlayerImpl::setSinkId(
528 const blink::WebString& sink_id, 545 const blink::WebString& sink_id,
529 const blink::WebSecurityOrigin& security_origin, 546 const blink::WebSecurityOrigin& security_origin,
530 blink::WebSetSinkIdCallbacks* web_callback) { 547 blink::WebSetSinkIdCallbacks* web_callback) {
531 DCHECK(main_task_runner_->BelongsToCurrentThread()); 548 DCHECK(main_task_runner_->BelongsToCurrentThread());
532 DVLOG(1) << __func__; 549 DVLOG(1) << __func__;
533 550
534 media::OutputDeviceStatusCB callback = 551 media::OutputDeviceStatusCB callback =
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 } 884 }
868 885
869 void WebMediaPlayerImpl::OnEncryptedMediaInitData( 886 void WebMediaPlayerImpl::OnEncryptedMediaInitData(
870 EmeInitDataType init_data_type, 887 EmeInitDataType init_data_type,
871 const std::vector<uint8_t>& init_data) { 888 const std::vector<uint8_t>& init_data) {
872 DCHECK(init_data_type != EmeInitDataType::UNKNOWN); 889 DCHECK(init_data_type != EmeInitDataType::UNKNOWN);
873 890
874 // TODO(xhwang): Update this UMA name. https://crbug.com/589251 891 // TODO(xhwang): Update this UMA name. https://crbug.com/589251
875 UMA_HISTOGRAM_COUNTS("Media.EME.NeedKey", 1); 892 UMA_HISTOGRAM_COUNTS("Media.EME.NeedKey", 1);
876 893
894 is_encrypted_ = true;
877 encrypted_client_->encrypted( 895 encrypted_client_->encrypted(
878 ConvertToWebInitDataType(init_data_type), init_data.data(), 896 ConvertToWebInitDataType(init_data_type), init_data.data(),
879 base::saturated_cast<unsigned int>(init_data.size())); 897 base::saturated_cast<unsigned int>(init_data.size()));
880 } 898 }
881 899
882 void WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated( 900 void WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated(
883 std::unique_ptr<MediaTracks> tracks) { 901 std::unique_ptr<MediaTracks> tracks) {
884 // For MSE/chunk_demuxer case the media track updates are handled by 902 // For MSE/chunk_demuxer case the media track updates are handled by
885 // WebSourceBufferImpl. 903 // WebSourceBufferImpl.
886 DCHECK(demuxer_.get()); 904 DCHECK(demuxer_.get());
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 if (paused_) { 956 if (paused_) {
939 #if defined(OS_ANDROID) // WMPI_CAST 957 #if defined(OS_ANDROID) // WMPI_CAST
940 if (isRemote()) { 958 if (isRemote()) {
941 paused_time_ = base::TimeDelta::FromSecondsD(cast_impl_.currentTime()); 959 paused_time_ = base::TimeDelta::FromSecondsD(cast_impl_.currentTime());
942 } else { 960 } else {
943 paused_time_ = pipeline_.GetMediaTime(); 961 paused_time_ = pipeline_.GetMediaTime();
944 } 962 }
945 #else 963 #else
946 paused_time_ = pipeline_.GetMediaTime(); 964 paused_time_ = pipeline_.GetMediaTime();
947 #endif 965 #endif
966 } else {
967 watch_time_reporter_->OnPlaying();
948 } 968 }
949 if (time_updated) 969 if (time_updated)
950 should_notify_time_changed_ = true; 970 should_notify_time_changed_ = true;
951 } 971 }
952 972
953 void WebMediaPlayerImpl::OnPipelineSuspended() { 973 void WebMediaPlayerImpl::OnPipelineSuspended() {
954 #if defined(OS_ANDROID) 974 #if defined(OS_ANDROID)
955 if (isRemote()) { 975 if (isRemote()) {
956 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner(); 976 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner();
957 if (frame) 977 if (frame)
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 // expected to be a no-op. 1039 // expected to be a no-op.
1020 UpdatePlayState(); 1040 UpdatePlayState();
1021 } 1041 }
1022 1042
1023 void WebMediaPlayerImpl::OnMetadata(PipelineMetadata metadata) { 1043 void WebMediaPlayerImpl::OnMetadata(PipelineMetadata metadata) {
1024 DVLOG(1) << __func__; 1044 DVLOG(1) << __func__;
1025 DCHECK(main_task_runner_->BelongsToCurrentThread()); 1045 DCHECK(main_task_runner_->BelongsToCurrentThread());
1026 1046
1027 pipeline_metadata_ = metadata; 1047 pipeline_metadata_ = metadata;
1028 1048
1049 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata);
1029 UMA_HISTOGRAM_ENUMERATION("Media.VideoRotation", metadata.video_rotation, 1050 UMA_HISTOGRAM_ENUMERATION("Media.VideoRotation", metadata.video_rotation,
1030 VIDEO_ROTATION_MAX + 1); 1051 VIDEO_ROTATION_MAX + 1);
1031 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata);
1032 1052
1033 if (hasVideo()) { 1053 if (hasVideo()) {
1034 pipeline_metadata_.natural_size = GetRotatedVideoSize( 1054 pipeline_metadata_.natural_size = GetRotatedVideoSize(
1035 pipeline_metadata_.video_rotation, pipeline_metadata_.natural_size); 1055 pipeline_metadata_.video_rotation, pipeline_metadata_.natural_size);
1036 1056
1037 if (overlay_enabled_ && surface_manager_) 1057 if (overlay_enabled_ && surface_manager_)
1038 surface_manager_->NaturalSizeChanged(pipeline_metadata_.natural_size); 1058 surface_manager_->NaturalSizeChanged(pipeline_metadata_.natural_size);
1039 1059
1040 DCHECK(!video_weblayer_); 1060 DCHECK(!video_weblayer_);
1041 video_weblayer_.reset(new cc_blink::WebLayerImpl(cc::VideoLayer::Create( 1061 video_weblayer_.reset(new cc_blink::WebLayerImpl(cc::VideoLayer::Create(
1042 compositor_, pipeline_metadata_.video_rotation))); 1062 compositor_, pipeline_metadata_.video_rotation)));
1043 video_weblayer_->layer()->SetContentsOpaque(opaque_); 1063 video_weblayer_->layer()->SetContentsOpaque(opaque_);
1044 video_weblayer_->SetContentsOpaqueIsFixed(true); 1064 video_weblayer_->SetContentsOpaqueIsFixed(true);
1045 client_->setWebLayer(video_weblayer_.get()); 1065 client_->setWebLayer(video_weblayer_.get());
1046 } 1066 }
1047 1067
1068 // Create the watch time reporter and synchronize its initial state.
1069 watch_time_reporter_.reset(new WatchTimeReporter(
1070 hasAudio(), hasVideo(), !!chunk_demuxer_, is_encrypted_, media_log_,
1071 pipeline_metadata_.natural_size,
1072 base::Bind(&GetCurrentTimeInternal, this)));
1073 watch_time_reporter_->OnVolumeChange(volume_);
1074 if (delegate_ && delegate_->IsHidden())
1075 watch_time_reporter_->OnHidden();
1076 else
1077 watch_time_reporter_->OnShown();
1078
1048 UpdatePlayState(); 1079 UpdatePlayState();
1049 } 1080 }
1050 1081
1051 void WebMediaPlayerImpl::OnBufferingStateChange(BufferingState state) { 1082 void WebMediaPlayerImpl::OnBufferingStateChange(BufferingState state) {
1052 DVLOG(1) << __func__ << "(" << state << ")"; 1083 DVLOG(1) << __func__ << "(" << state << ")";
1053 DCHECK(main_task_runner_->BelongsToCurrentThread()); 1084 DCHECK(main_task_runner_->BelongsToCurrentThread());
1054 1085
1055 // Ignore buffering state changes until we've completed all outstanding 1086 // Ignore buffering state changes until we've completed all outstanding
1056 // operations. 1087 // operations.
1057 if (!pipeline_controller_.IsStable()) 1088 if (!pipeline_controller_.IsStable())
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 1187
1157 opaque_ = opaque; 1188 opaque_ = opaque;
1158 // Modify content opaqueness of cc::Layer directly so that 1189 // Modify content opaqueness of cc::Layer directly so that
1159 // SetContentsOpaqueIsFixed is ignored. 1190 // SetContentsOpaqueIsFixed is ignored.
1160 if (video_weblayer_) 1191 if (video_weblayer_)
1161 video_weblayer_->layer()->SetContentsOpaque(opaque_); 1192 video_weblayer_->layer()->SetContentsOpaque(opaque_);
1162 } 1193 }
1163 1194
1164 void WebMediaPlayerImpl::OnHidden() { 1195 void WebMediaPlayerImpl::OnHidden() {
1165 DCHECK(main_task_runner_->BelongsToCurrentThread()); 1196 DCHECK(main_task_runner_->BelongsToCurrentThread());
1197 if (watch_time_reporter_)
1198 watch_time_reporter_->OnHidden();
1166 1199
1167 UpdatePlayState(); 1200 UpdatePlayState();
1168 1201
1169 // Schedule suspended playing media to be paused if the user doesn't come back 1202 // Schedule suspended playing media to be paused if the user doesn't come back
1170 // to it within some timeout period to avoid any autoplay surprises. 1203 // to it within some timeout period to avoid any autoplay surprises.
1171 ScheduleIdlePauseTimer(); 1204 ScheduleIdlePauseTimer();
1172 } 1205 }
1173 1206
1174 void WebMediaPlayerImpl::OnShown() { 1207 void WebMediaPlayerImpl::OnShown() {
1175 DCHECK(main_task_runner_->BelongsToCurrentThread()); 1208 DCHECK(main_task_runner_->BelongsToCurrentThread());
1209 if (watch_time_reporter_)
1210 watch_time_reporter_->OnShown();
1211
1176 must_suspend_ = false; 1212 must_suspend_ = false;
1177 background_pause_timer_.Stop(); 1213 background_pause_timer_.Stop();
1178 1214
1179 UpdatePlayState(); 1215 UpdatePlayState();
1180 } 1216 }
1181 1217
1182 void WebMediaPlayerImpl::OnSuspendRequested(bool must_suspend) { 1218 void WebMediaPlayerImpl::OnSuspendRequested(bool must_suspend) {
1183 DCHECK(main_task_runner_->BelongsToCurrentThread()); 1219 DCHECK(main_task_runner_->BelongsToCurrentThread());
1184 1220
1185 if (must_suspend) { 1221 if (must_suspend) {
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 if (isRemote()) 1784 if (isRemote())
1749 return; 1785 return;
1750 #endif 1786 #endif
1751 1787
1752 // Idle timeout chosen arbitrarily. 1788 // Idle timeout chosen arbitrarily.
1753 background_pause_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(5), 1789 background_pause_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(5),
1754 this, &WebMediaPlayerImpl::OnPause); 1790 this, &WebMediaPlayerImpl::OnPause);
1755 } 1791 }
1756 1792
1757 } // namespace media 1793 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698