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

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

Issue 1807053002: Speculative crash fix for media::RendererImpl::GetMediaTime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile fix Created 4 years, 9 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 | « no previous file | no next file » | 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 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 856
857 set_cdm_result_->completeWithError( 857 set_cdm_result_->completeWithError(
858 blink::WebContentDecryptionModuleExceptionNotSupportedError, 0, 858 blink::WebContentDecryptionModuleExceptionNotSupportedError, 0,
859 "Unable to set MediaKeys object"); 859 "Unable to set MediaKeys object");
860 set_cdm_result_.reset(); 860 set_cdm_result_.reset();
861 } 861 }
862 862
863 void WebMediaPlayerImpl::OnPipelineSeeked(bool time_updated) { 863 void WebMediaPlayerImpl::OnPipelineSeeked(bool time_updated) {
864 seeking_ = false; 864 seeking_ = false;
865 seek_time_ = base::TimeDelta(); 865 seek_time_ = base::TimeDelta();
866 if (paused_) 866 if (paused_) {
867 #if defined(OS_ANDROID) // WMPI_CAST
868 if (isRemote()) {
869 paused_time_ = base::TimeDelta::FromSecondsD(cast_impl_.currentTime());
870 } else {
871 paused_time_ = pipeline_.GetMediaTime();
872 }
873 #else
867 paused_time_ = pipeline_.GetMediaTime(); 874 paused_time_ = pipeline_.GetMediaTime();
875 #endif
876 }
868 if (time_updated) 877 if (time_updated)
869 should_notify_time_changed_ = true; 878 should_notify_time_changed_ = true;
870 } 879 }
871 880
872 void WebMediaPlayerImpl::OnPipelineSuspended() { 881 void WebMediaPlayerImpl::OnPipelineSuspended() {
873 #if defined(OS_ANDROID) 882 #if defined(OS_ANDROID)
874 if (isRemote()) { 883 if (isRemote()) {
875 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner(); 884 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner();
876 if (frame) { 885 if (frame) {
877 compositor_->PaintFrameUsingOldRenderingPath(frame); 886 compositor_->PaintFrameUsingOldRenderingPath(frame);
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() { 1492 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() {
1484 #if defined(OS_ANDROID) 1493 #if defined(OS_ANDROID)
1485 return !hasVideo() || (delegate_ && !delegate_->IsHidden()); 1494 return !hasVideo() || (delegate_ && !delegate_->IsHidden());
1486 #else 1495 #else
1487 // On non-Android platforms Resume() is always allowed. 1496 // On non-Android platforms Resume() is always allowed.
1488 return true; 1497 return true;
1489 #endif 1498 #endif
1490 } 1499 }
1491 1500
1492 } // namespace media 1501 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698