| 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 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1395 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1396 DCHECK_NE(ready_state_, WebMediaPlayer::ReadyStateHaveNothing); | 1396 DCHECK_NE(ready_state_, WebMediaPlayer::ReadyStateHaveNothing); |
| 1397 | 1397 |
| 1398 opaque_ = opaque; | 1398 opaque_ = opaque; |
| 1399 // Modify content opaqueness of cc::Layer directly so that | 1399 // Modify content opaqueness of cc::Layer directly so that |
| 1400 // SetContentsOpaqueIsFixed is ignored. | 1400 // SetContentsOpaqueIsFixed is ignored. |
| 1401 if (video_weblayer_) | 1401 if (video_weblayer_) |
| 1402 video_weblayer_->layer()->SetContentsOpaque(opaque_); | 1402 video_weblayer_->layer()->SetContentsOpaque(opaque_); |
| 1403 } | 1403 } |
| 1404 | 1404 |
| 1405 void WebMediaPlayerImpl::OnVideoAverageKeyframeDistanceUpdate() { |
| 1406 UpdateBackgroundVideoOptimizationState(); |
| 1407 } |
| 1408 |
| 1405 void WebMediaPlayerImpl::OnFrameHidden() { | 1409 void WebMediaPlayerImpl::OnFrameHidden() { |
| 1406 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1410 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1407 | 1411 |
| 1408 if (watch_time_reporter_) | 1412 if (watch_time_reporter_) |
| 1409 watch_time_reporter_->OnHidden(); | 1413 watch_time_reporter_->OnHidden(); |
| 1410 | 1414 |
| 1411 // OnFrameHidden() can be called when frame is closed, then IsHidden() will | 1415 // OnFrameHidden() can be called when frame is closed, then IsHidden() will |
| 1412 // return false, so check explicitly. | 1416 // return false, so check explicitly. |
| 1413 if (IsHidden()) { | 1417 if (IsHidden()) { |
| 1414 if (ShouldPauseVideoWhenHidden()) { | 1418 if (ShouldPauseVideoWhenHidden()) { |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2263 UMA_HISTOGRAM_TIMES( | 2267 UMA_HISTOGRAM_TIMES( |
| 2264 "Media.Video.TimeFromForegroundToFirstFrame.DisableTrack", | 2268 "Media.Video.TimeFromForegroundToFirstFrame.DisableTrack", |
| 2265 time_to_first_frame); | 2269 time_to_first_frame); |
| 2266 } else { | 2270 } else { |
| 2267 UMA_HISTOGRAM_TIMES("Media.Video.TimeFromForegroundToFirstFrame.Paused", | 2271 UMA_HISTOGRAM_TIMES("Media.Video.TimeFromForegroundToFirstFrame.Paused", |
| 2268 time_to_first_frame); | 2272 time_to_first_frame); |
| 2269 } | 2273 } |
| 2270 } | 2274 } |
| 2271 | 2275 |
| 2272 } // namespace media | 2276 } // namespace media |
| OLD | NEW |