Bug 1031532 - Hold the SourceBufferResource monitor during eviction. r=cajbir
authorMatthew Gregan <kinetik@flim.org>
Mon, 14 Jul 2014 22:41:00 +1200
changeset 193987 73300964c5109ada8e009c77747bd232d85e4372
parent 193986 cc69e484c0e10d5348287e2aa0f1aa587c134a16
child 193988 45f825a8358716a2e4c73b90e8afdef6fd3ac4b8
push id27136
push usercbook@mozilla.com
push dateTue, 15 Jul 2014 12:59:16 +0000
treeherdermozilla-central@d2d56f9066bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscajbir
bugs1031532
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1031532 - Hold the SourceBufferResource monitor during eviction. r=cajbir
content/media/mediasource/SourceBufferResource.cpp
--- a/content/media/mediasource/SourceBufferResource.cpp
+++ b/content/media/mediasource/SourceBufferResource.cpp
@@ -124,22 +124,24 @@ SourceBufferResource::ReadFromCache(char
     return rv;
   }
   return Read(aBuffer, aCount, nullptr);
 }
 
 bool
 SourceBufferResource::EvictData(uint32_t aThreshold)
 {
+  ReentrantMonitorAutoEnter mon(mMonitor);
   return mInputBuffer.Evict(mOffset, aThreshold);
 }
 
 void
 SourceBufferResource::EvictBefore(uint64_t aOffset)
 {
+  ReentrantMonitorAutoEnter mon(mMonitor);
   // If aOffset is past the current playback offset we don't evict.
   if (aOffset < mOffset) {
     mInputBuffer.Evict(aOffset, 0);
   }
 }
 
 void
 SourceBufferResource::AppendData(const uint8_t* aData, uint32_t aLength)