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

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

Issue 2552493002: [Media] Record time it takes to start rendering audio and video (Closed)
Patch Set: Accessing VFC directly from WMPI Created 3 years, 11 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 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 // Schedule suspended playing media to be paused if the user doesn't come back 1333 // Schedule suspended playing media to be paused if the user doesn't come back
1334 // to it within some timeout period to avoid any autoplay surprises. 1334 // to it within some timeout period to avoid any autoplay surprises.
1335 ScheduleIdlePauseTimer(); 1335 ScheduleIdlePauseTimer();
1336 } 1336 }
1337 1337
1338 void WebMediaPlayerImpl::OnShown() { 1338 void WebMediaPlayerImpl::OnShown() {
1339 DCHECK(main_task_runner_->BelongsToCurrentThread()); 1339 DCHECK(main_task_runner_->BelongsToCurrentThread());
1340 if (watch_time_reporter_) 1340 if (watch_time_reporter_)
1341 watch_time_reporter_->OnShown(); 1341 watch_time_reporter_->OnShown();
1342 1342
1343 compositor_task_runner_->PostTask(
1344 FROM_HERE,
1345 base::Bind(&VideoFrameCompositor::SetShownTimestamp,
1346 base::Unretained(compositor_), base::TimeTicks::Now()));
1347
1343 if (IsBackgroundVideoTrackOptimizationEnabled() && 1348 if (IsBackgroundVideoTrackOptimizationEnabled() &&
1344 client_->hasSelectedVideoTrack()) { 1349 client_->hasSelectedVideoTrack()) {
1345 WebMediaPlayer::TrackId trackId = client_->getSelectedVideoTrackId(); 1350 WebMediaPlayer::TrackId trackId = client_->getSelectedVideoTrackId();
1346 selectedVideoTrackChanged(&trackId); 1351 selectedVideoTrackChanged(&trackId);
1347 } 1352 }
1348 1353
1349 must_suspend_ = false; 1354 must_suspend_ = false;
1350 background_pause_timer_.Stop(); 1355 background_pause_timer_.Stop();
1351 1356
1352 UpdatePlayState(); 1357 UpdatePlayState();
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 return delegate_ && delegate_->IsHidden(); 2016 return delegate_ && delegate_->IsHidden();
2012 } 2017 }
2013 2018
2014 void WebMediaPlayerImpl::ActivateViewportIntersectionMonitoring(bool activate) { 2019 void WebMediaPlayerImpl::ActivateViewportIntersectionMonitoring(bool activate) {
2015 DCHECK(main_task_runner_->BelongsToCurrentThread()); 2020 DCHECK(main_task_runner_->BelongsToCurrentThread());
2016 2021
2017 client_->activateViewportIntersectionMonitoring(activate); 2022 client_->activateViewportIntersectionMonitoring(activate);
2018 } 2023 }
2019 2024
2020 } // namespace media 2025 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698