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

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: Shown->Foreground 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
« no previous file with comments | « media/blink/video_frame_compositor.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 // Schedule suspended playing media to be paused if the user doesn't come back 1347 // Schedule suspended playing media to be paused if the user doesn't come back
1348 // to it within some timeout period to avoid any autoplay surprises. 1348 // to it within some timeout period to avoid any autoplay surprises.
1349 ScheduleIdlePauseTimer(); 1349 ScheduleIdlePauseTimer();
1350 } 1350 }
1351 1351
1352 void WebMediaPlayerImpl::OnShown() { 1352 void WebMediaPlayerImpl::OnShown() {
1353 DCHECK(main_task_runner_->BelongsToCurrentThread()); 1353 DCHECK(main_task_runner_->BelongsToCurrentThread());
1354 if (watch_time_reporter_) 1354 if (watch_time_reporter_)
1355 watch_time_reporter_->OnShown(); 1355 watch_time_reporter_->OnShown();
1356 1356
1357 compositor_task_runner_->PostTask(
1358 FROM_HERE,
1359 base::Bind(&VideoFrameCompositor::SetForegroundTime,
1360 base::Unretained(compositor_), base::TimeTicks::Now()));
1361
1357 if (IsBackgroundVideoTrackOptimizationEnabled() && 1362 if (IsBackgroundVideoTrackOptimizationEnabled() &&
1358 client_->hasSelectedVideoTrack()) { 1363 client_->hasSelectedVideoTrack()) {
1359 WebMediaPlayer::TrackId trackId = client_->getSelectedVideoTrackId(); 1364 WebMediaPlayer::TrackId trackId = client_->getSelectedVideoTrackId();
1360 selectedVideoTrackChanged(&trackId); 1365 selectedVideoTrackChanged(&trackId);
1361 } 1366 }
1362 1367
1363 must_suspend_ = false; 1368 must_suspend_ = false;
1364 background_pause_timer_.Stop(); 1369 background_pause_timer_.Stop();
1365 1370
1366 UpdatePlayState(); 1371 UpdatePlayState();
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 return pipeline_metadata_.video_rotation == VIDEO_ROTATION_0; 2039 return pipeline_metadata_.video_rotation == VIDEO_ROTATION_0;
2035 } 2040 }
2036 2041
2037 void WebMediaPlayerImpl::ActivateViewportIntersectionMonitoring(bool activate) { 2042 void WebMediaPlayerImpl::ActivateViewportIntersectionMonitoring(bool activate) {
2038 DCHECK(main_task_runner_->BelongsToCurrentThread()); 2043 DCHECK(main_task_runner_->BelongsToCurrentThread());
2039 2044
2040 client_->activateViewportIntersectionMonitoring(activate); 2045 client_->activateViewportIntersectionMonitoring(activate);
2041 } 2046 }
2042 2047
2043 } // namespace media 2048 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/video_frame_compositor.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698