Bug 1741201 - Increase intermediate byte storage maximum capacity. r=janv, a=tjr

gre-tracking
roytam1 7 months ago
parent 258790bf38
commit 7d7c1ab08a
  1. 14
      dom/indexedDB/ActorsParent.cpp

@ -26311,13 +26311,17 @@ ObjectStoreAddOrPutRequestOp::DoDatabaseWork(DatabaseConnection* aConnection)
return rv;
}
} else {
nsCString flatCloneData;
flatCloneData.SetLength(cloneDataSize);
auto iter = cloneData.Start();
cloneData.ReadBytes(iter, flatCloneData.BeginWriting(), cloneDataSize);
AutoTArray<char, 4096> flatCloneData; // 4096 from JSStructuredCloneData
if (!flatCloneData.SetLength(cloneDataSize, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
{ // iter scope
auto iter = cloneData.Start();
MOZ_ALWAYS_TRUE(cloneData.ReadBytes(iter, flatCloneData.Elements(), cloneDataSize));
}
// Compress the bytes before adding into the database.
const char* uncompressed = flatCloneData.BeginReading();
const char* uncompressed = flatCloneData.Elements();
size_t uncompressedLength = cloneDataSize;
size_t compressedLength = snappy::MaxCompressedLength(uncompressedLength);

Loading…
Cancel
Save