mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-26 00:57:30 +09:00
Bug 1741201 - Increase intermediate byte storage maximum capacity. r=janv, a=tjr
This commit is contained in:
parent
258790bf38
commit
7d7c1ab08a
1 changed files with 9 additions and 5 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue