summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-01-14 13:32:45 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-08 15:04:04 +0200
commit82fa1fbf1415d50adbe34309393e3181b06f1b75 (patch)
treeca11720cc3cbd438d9bebdf0e0f35fa2fc8f5830 /dom
parentfaec3f2140ee5d068f17bd857f3e0a1e297d7fbd (diff)
downloaduxp-82fa1fbf1415d50adbe34309393e3181b06f1b75.tar.gz
[DOM IndexedDB] Increase intermediate byte storage maximum capacity.
Diffstat (limited to 'dom')
-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 9203f9ee41..52f221d78a 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);