Bug 1173195 - Don't assert success until successful in GMPSharedMemManager. r=edwin
authorChris Pearce <cpearce@mozilla.com>
Thu, 16 Jul 2015 16:53:39 +1200
changeset 253139 f81abae3fcea14413b559c2a99ec9b28ff672a12
parent 253138 47193134162b6c35527d3877c26765e330f7f725
child 253140 085f96014278d0cbef9e3a372146cc3ed406224e
push id29061
push userryanvm@gmail.com
push dateThu, 16 Jul 2015 18:53:45 +0000
treeherdermozilla-central@a0f4a688433d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1173195
milestone42.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 1173195 - Don't assert success until successful in GMPSharedMemManager. r=edwin
dom/media/gmp/GMPSharedMemManager.cpp
--- a/dom/media/gmp/GMPSharedMemManager.cpp
+++ b/dom/media/gmp/GMPSharedMemManager.cpp
@@ -35,19 +35,19 @@ GMPSharedMemManager::MgrAllocShmem(GMPSh
       return true;
     }
   }
 
   // Didn't find a buffer free with enough space; allocate one
   size_t pagesize = ipc::SharedMemory::SystemPageSize();
   aSize = (aSize + (pagesize-1)) & ~(pagesize-1); // round up to page size
   bool retval = Alloc(aSize, aType, aMem);
-  // The allocator (or NeedsShmem call) should never return less than we ask for...
-  MOZ_ASSERT(aMem->Size<uint8_t>() >= aSize);
   if (retval) {
+    // The allocator (or NeedsShmem call) should never return less than we ask for...
+    MOZ_ASSERT(aMem->Size<uint8_t>() >= aSize);
     mData->mGmpAllocated[aClass]++;
   }
   return retval;
 }
 
 bool
 GMPSharedMemManager::MgrDeallocShmem(GMPSharedMem::GMPMemoryClasses aClass, ipc::Shmem& aMem)
 {