Bug 1474701: Fix shutdown profile-save (fix imbalance) and add JSONWriter assertions r=mstange,njn

This commit is contained in:
Randell Jesup 2018-08-06 10:44:26 -04:00
parent d60c68ce16
commit 85a1661cdc
2 changed files with 3 additions and 1 deletions

View File

@ -93,6 +93,7 @@
#define mozilla_JSONWriter_h
#include "double-conversion/double-conversion.h"
#include "mozilla/Assertions.h"
#include "mozilla/IntegerPrintfMacros.h"
#include "mozilla/PodOperations.h"
#include "mozilla/Sprintf.h"
@ -326,6 +327,7 @@ protected:
// Adds the whitespace and closing char necessary to end a collection.
void EndCollection(const char* aEndChar)
{
MOZ_ASSERT(mDepth > 0);
if (mNeedNewlines[mDepth]) {
mWriter->Write("\n");
mDepth--;

View File

@ -1779,8 +1779,8 @@ StreamMetaJSCustomObject(PSLockRef aLock, SpliceableJSONWriter& aWriter,
}
aWriter.EndArray();
}
aWriter.EndObject();
}
aWriter.EndObject();
}
#if defined(GP_OS_android)