| 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 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1417 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1417 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1418 DCHECK_NE(ready_state_, WebMediaPlayer::ReadyStateHaveNothing); | 1418 DCHECK_NE(ready_state_, WebMediaPlayer::ReadyStateHaveNothing); |
| 1419 | 1419 |
| 1420 opaque_ = opaque; | 1420 opaque_ = opaque; |
| 1421 // Modify content opaqueness of cc::Layer directly so that | 1421 // Modify content opaqueness of cc::Layer directly so that |
| 1422 // SetContentsOpaqueIsFixed is ignored. | 1422 // SetContentsOpaqueIsFixed is ignored. |
| 1423 if (video_weblayer_) | 1423 if (video_weblayer_) |
| 1424 video_weblayer_->layer()->SetContentsOpaque(opaque_); | 1424 video_weblayer_->layer()->SetContentsOpaque(opaque_); |
| 1425 } | 1425 } |
| 1426 | 1426 |
| 1427 void WebMediaPlayerImpl::OnVideoAverageKeyframeDistanceUpdate() { |
| 1428 UpdateBackgroundVideoOptimizationState(); |
| 1429 } |
| 1430 |
| 1427 void WebMediaPlayerImpl::OnFrameHidden() { | 1431 void WebMediaPlayerImpl::OnFrameHidden() { |
| 1428 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1432 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1429 | 1433 |
| 1430 if (watch_time_reporter_) | 1434 if (watch_time_reporter_) |
| 1431 watch_time_reporter_->OnHidden(); | 1435 watch_time_reporter_->OnHidden(); |
| 1432 | 1436 |
| 1433 // OnFrameHidden() can be called when frame is closed, then IsHidden() will | 1437 // OnFrameHidden() can be called when frame is closed, then IsHidden() will |
| 1434 // return false, so check explicitly. | 1438 // return false, so check explicitly. |
| 1435 if (IsHidden()) { | 1439 if (IsHidden()) { |
| 1436 if (ShouldPauseVideoWhenHidden()) { | 1440 if (ShouldPauseVideoWhenHidden()) { |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2281 UMA_HISTOGRAM_TIMES( | 2285 UMA_HISTOGRAM_TIMES( |
| 2282 "Media.Video.TimeFromForegroundToFirstFrame.DisableTrack", | 2286 "Media.Video.TimeFromForegroundToFirstFrame.DisableTrack", |
| 2283 time_to_first_frame); | 2287 time_to_first_frame); |
| 2284 } else { | 2288 } else { |
| 2285 UMA_HISTOGRAM_TIMES("Media.Video.TimeFromForegroundToFirstFrame.Paused", | 2289 UMA_HISTOGRAM_TIMES("Media.Video.TimeFromForegroundToFirstFrame.Paused", |
| 2286 time_to_first_frame); | 2290 time_to_first_frame); |
| 2287 } | 2291 } |
| 2288 } | 2292 } |
| 2289 | 2293 |
| 2290 } // namespace media | 2294 } // namespace media |
| OLD | NEW |