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

Unified Diff: media/blink/multibuffer_data_source.cc

Issue 2341483003: MultibufferDataSource: Handle HasSingleOrigin() before init completes. (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 | no next file » | 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 9c776f5b3f8e35c0c2851efa4b81286eff79b914..12988760708722d172f608cb83d3bb109ce8bff5 100644
--- a/media/blink/multibuffer_data_source.cc
+++ b/media/blink/multibuffer_data_source.cc
@@ -248,8 +248,10 @@ void MultibufferDataSource::SetBufferingStrategy(
bool MultibufferDataSource::HasSingleOrigin() {
DCHECK(render_task_runner_->BelongsToCurrentThread());
- DCHECK(init_cb_.is_null() && reader_.get())
- << "Initialize() must complete before calling HasSingleOrigin()";
+ // Before initialization completes there is no risk of leaking data. Callers
+ // are required to order checks such that this isn't a race.
+ if (!init_cb_.is_null())
+ return true;
hubbe 2016/09/13 22:43:23 single_origin_ defaults to true, so this if statem
sandersd (OOO until July 31) 2016/09/13 22:50:37 But now it looks like it took me seconds to make t
return single_origin_;
}
« 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