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

Unified Diff: third_party/WebKit/Source/modules/mediasource/MediaSource.cpp

Issue 2133143003: Allow multiple URL.createObjectURL invocations for MediaSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 5 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 | « third_party/WebKit/Source/modules/mediasource/MediaSource.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
index 16149c109ac69d0b8115ab7b43ecbb26ccd1707d..ba2964942de764957c9bc970308265e1ee235388 100644
--- a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
+++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
@@ -106,7 +106,7 @@ MediaSource::MediaSource(ExecutionContext* context)
, m_sourceBuffers(SourceBufferList::create(getExecutionContext(), m_asyncEventQueue.get()))
, m_activeSourceBuffers(SourceBufferList::create(getExecutionContext(), m_asyncEventQueue.get()))
, m_liveSeekableRange(TimeRanges::create())
- , m_isAddedToRegistry(false)
+ , m_addedToRegistryCounter(0)
{
MSLOG << __FUNCTION__ << " this=" << this;
}
@@ -302,14 +302,15 @@ void MediaSource::setWebMediaSourceAndOpen(std::unique_ptr<WebMediaSource> webMe
void MediaSource::addedToRegistry()
{
- DCHECK(!m_isAddedToRegistry);
- m_isAddedToRegistry = true;
+ ++m_addedToRegistryCounter;
+ // Ensure there's no counter overflow.
+ CHECK_GT(m_addedToRegistryCounter, 0);
}
void MediaSource::removedFromRegistry()
{
- DCHECK(m_isAddedToRegistry);
- m_isAddedToRegistry = false;
+ DCHECK_GT(m_addedToRegistryCounter, 0);
+ --m_addedToRegistryCounter;
}
double MediaSource::duration() const
@@ -648,7 +649,7 @@ bool MediaSource::hasPendingActivity() const
{
return m_attachedElement || m_webMediaSource
|| m_asyncEventQueue->hasPendingEvents()
- || m_isAddedToRegistry;
+ || m_addedToRegistryCounter > 0;
}
void MediaSource::stop()
« no previous file with comments | « third_party/WebKit/Source/modules/mediasource/MediaSource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698