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

Unified Diff: media/blink/multibuffer_data_source.cc

Issue 2357773003: Fix a timing bug in multibuffer. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/blink/multibuffer_data_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/multibuffer_data_source.cc
diff --git a/media/blink/multibuffer_data_source.cc b/media/blink/multibuffer_data_source.cc
index a343fee303aef91f428fcad47dcf86f04ba6b61a..96c6aa28f80b11daa70ef6eadad687927da251d5 100644
--- a/media/blink/multibuffer_data_source.cc
+++ b/media/blink/multibuffer_data_source.cc
@@ -517,10 +517,11 @@ void MultibufferDataSource::ProgressCallback(int64_t begin, int64_t end) {
if (assume_fully_buffered())
return;
+ base::AutoLock auto_lock(lock_);
+
if (end > begin) {
// TODO(scherkus): we shouldn't have to lock to signal host(), see
// http://crbug.com/113712 for details.
- base::AutoLock auto_lock(lock_);
if (stop_signal_received_)
return;
@@ -532,10 +533,13 @@ void MultibufferDataSource::ProgressCallback(int64_t begin, int64_t end) {
void MultibufferDataSource::UpdateLoadingState(bool force_loading) {
sandersd (OOO until July 31) 2016/09/21 01:13:39 Nit: Add _Locked suffix?
hubbe 2016/09/21 04:19:22 Done
DVLOG(1) << __func__;
+ lock_.AssertAcquired();
if (assume_fully_buffered())
return;
// Update loading state.
bool is_loading = !!reader_ && reader_->IsLoading();
+ if (read_op_)
+ is_loading = true;
sandersd (OOO until July 31) 2016/09/21 01:13:39 This means nothing to me, but I'll believe you.
hubbe 2016/09/21 04:19:22 Well, basically we can't destroy reader_ if there
if (force_loading || is_loading != loading_) {
loading_ = is_loading || force_loading;
« no previous file with comments | « no previous file | media/blink/multibuffer_data_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698