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

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

Issue 1803363002: Add missing null check on |data_source_| (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 } 879 }
880 #endif 880 #endif
881 881
882 memory_usage_reporting_timer_.Stop(); 882 memory_usage_reporting_timer_.Stop();
883 ReportMemoryUsage(); 883 ReportMemoryUsage();
884 884
885 // If we're not in an aggressive buffering state, tell the data source we have 885 // If we're not in an aggressive buffering state, tell the data source we have
886 // enough data so that it may release the connection. 886 // enough data so that it may release the connection.
887 if (buffering_strategy_ != 887 if (buffering_strategy_ !=
888 BufferedDataSource::BUFFERING_STRATEGY_AGGRESSIVE) { 888 BufferedDataSource::BUFFERING_STRATEGY_AGGRESSIVE) {
889 data_source_->OnBufferingHaveEnough(true); 889 if (data_source_)
890 data_source_->OnBufferingHaveEnough(true);
890 } 891 }
891 892
892 if (pending_suspend_resume_cycle_) { 893 if (pending_suspend_resume_cycle_) {
893 pending_suspend_resume_cycle_ = false; 894 pending_suspend_resume_cycle_ = false;
894 pipeline_controller_.Resume(); 895 pipeline_controller_.Resume();
895 return; 896 return;
896 } 897 }
897 } 898 }
898 899
899 void WebMediaPlayerImpl::OnPipelineResumed() { 900 void WebMediaPlayerImpl::OnPipelineResumed() {
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() { 1484 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() {
1484 #if defined(OS_ANDROID) 1485 #if defined(OS_ANDROID)
1485 return !hasVideo() || (delegate_ && !delegate_->IsHidden()); 1486 return !hasVideo() || (delegate_ && !delegate_->IsHidden());
1486 #else 1487 #else
1487 // On non-Android platforms Resume() is always allowed. 1488 // On non-Android platforms Resume() is always allowed.
1488 return true; 1489 return true;
1489 #endif 1490 #endif
1490 } 1491 }
1491 1492
1492 } // namespace media 1493 } // 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