summaryrefslogtreecommitdiff
path: root/dom/indexedDB
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-01-14 13:32:45 +0000
committerMoonchild <moonchild@palemoon.org>2022-01-14 13:32:45 +0000
commit1c6c5c81bc2f9789067431878558dd94642b9907 (patch)
treee1be18d1e50f3bf905ca2cbe3209ede18918e7b6 /dom/indexedDB
parent004f1daedd47a37ec423f55298da382b823cf538 (diff)
downloadaura-central-1c6c5c81bc2f9789067431878558dd94642b9907.tar.gz
[DOM IndexedDB] Increase intermediate byte storage maximum capacity.
Diffstat (limited to 'dom/indexedDB')
-rw-r--r--dom/indexedDB/ActorsParent.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp
index 9203f9ee4..52f221d78 100644
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/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);