Bug 1422815 - P1: Fix for failing to get quotaObject unexpectedly. r=bkelly
authorTom Tung <shes050117@gmail.com>
Wed, 06 Dec 2017 10:12:24 +0800
changeset 448141 dfa71cd9294d9d27b8a416e6fa7aef222e3b73d4
parent 448140 81174f568eaa91aa8f5f65e05f35f4350a8cfb25
child 448142 7c1f6b71b705053a968b258a0277fd6d4bcedd36
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1422815
milestone59.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 1422815 - P1: Fix for failing to get quotaObject unexpectedly. r=bkelly This patch is for avoiding use quotaObject while it does not exist in Release. Note that we sill catch this in Beta and Nightly by the assertion.
dom/cache/FileUtils.cpp
--- a/dom/cache/FileUtils.cpp
+++ b/dom/cache/FileUtils.cpp
@@ -292,16 +292,18 @@ BodyMaybeUpdatePaddingSize(const QuotaIn
   MOZ_DIAGNOSTIC_ASSERT(quotaManager);
 
   int64_t fileSize = 0;
   RefPtr<QuotaObject> quotaObject =
     quotaManager->GetQuotaObject(PERSISTENCE_TYPE_DEFAULT, aQuotaInfo.mGroup,
                                  aQuotaInfo.mOrigin, bodyFile, &fileSize);
   MOZ_DIAGNOSTIC_ASSERT(quotaObject);
   MOZ_DIAGNOSTIC_ASSERT(fileSize >= 0);
+  // XXXtt: bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1422815
+  if (!quotaObject) { return NS_ERROR_UNEXPECTED; }
 
   if (*aPaddingSizeOut == InternalResponse::UNKNOWN_PADDING_SIZE) {
     *aPaddingSizeOut = BodyGeneratePadding(fileSize, aPaddingInfo);
   }
 
   MOZ_DIAGNOSTIC_ASSERT(*aPaddingSizeOut >= 0);
 
   if (!quotaObject->IncreaseSize(*aPaddingSizeOut)) {