2018-11-12 17:19:01 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jacob Quant <jacobq@gmail.com>
|
2019-11-22 19:35:54 +00:00
|
|
|
Date: Thu, 31 Oct 2019 14:00:00 -0500
|
2018-11-12 17:19:01 +00:00
|
|
|
Subject: dom_storage_limits.patch
|
|
|
|
|
2019-11-22 19:35:54 +00:00
|
|
|
This patch increases the DOM storage (e.g. `localStorage`
|
|
|
|
and `sessionStorage`) size quota from 10MiB to 100MiB.
|
|
|
|
Previous versions of this patch attempted to circumvent
|
|
|
|
the restriction altogether.
|
|
|
|
However, this can lead to other problems, such as crashing
|
|
|
|
the Dev Tools when attempting to read or write values that exceed
|
|
|
|
`IPC::Channel::kMaximumMessageSize` (128MiB).
|
2018-11-12 17:19:01 +00:00
|
|
|
|
2019-11-22 19:35:54 +00:00
|
|
|
Increasing the quota rather than bypassing it reduces the
|
|
|
|
amount of chromium code that needs to be changed for Electron
|
|
|
|
as well as keeps these storage areas limited to a bounded
|
|
|
|
size meanwhile giving application developers more space to work with.
|
2018-11-12 17:19:01 +00:00
|
|
|
|
2019-12-11 00:22:35 +00:00
|
|
|
diff --git a/components/services/storage/dom_storage/dom_storage_constants.cc b/components/services/storage/dom_storage/dom_storage_constants.cc
|
2022-10-03 20:21:00 +00:00
|
|
|
index aa5edd1d07d97bee4912b14996ff804351240e94..8334b7eb6a3293c068f5234508f8dca780ccb262 100644
|
2019-12-11 00:22:35 +00:00
|
|
|
--- a/components/services/storage/dom_storage/dom_storage_constants.cc
|
|
|
|
+++ b/components/services/storage/dom_storage/dom_storage_constants.cc
|
|
|
|
@@ -6,7 +6,9 @@
|
|
|
|
|
|
|
|
namespace storage {
|
2019-01-12 01:00:43 +00:00
|
|
|
|
2019-11-22 19:35:54 +00:00
|
|
|
-const size_t kPerStorageAreaQuota = 10 * 1024 * 1024;
|
|
|
|
+// Electron's dom_storage_limits.patch increased this value from 10MiB to 100MiB
|
|
|
|
+const size_t kPerStorageAreaQuota = 100 * 1024 * 1024;
|
2019-12-11 00:22:35 +00:00
|
|
|
+
|
|
|
|
const size_t kPerStorageAreaOverQuotaAllowance = 100 * 1024;
|
2019-01-12 01:00:43 +00:00
|
|
|
|
2019-12-11 00:22:35 +00:00
|
|
|
} // namespace storage
|
2019-11-22 19:35:54 +00:00
|
|
|
diff --git a/third_party/blink/public/mojom/dom_storage/storage_area.mojom b/third_party/blink/public/mojom/dom_storage/storage_area.mojom
|
2024-07-02 07:51:33 +00:00
|
|
|
index 5902d8217c1b98d182f68f4199be4830c6177e68..2517c37be979cfe25ec8592cdbf8e53bab100c42 100644
|
2019-11-22 19:35:54 +00:00
|
|
|
--- a/third_party/blink/public/mojom/dom_storage/storage_area.mojom
|
|
|
|
+++ b/third_party/blink/public/mojom/dom_storage/storage_area.mojom
|
2020-03-03 21:35:05 +00:00
|
|
|
@@ -50,7 +50,8 @@ struct KeyValue {
|
2019-11-22 19:35:54 +00:00
|
|
|
interface StorageArea {
|
|
|
|
// The quota for each storage area.
|
|
|
|
// This value is enforced in renderer processes and the browser process.
|
|
|
|
- const uint32 kPerStorageAreaQuota = 10485760; // 10 MiB
|
|
|
|
+ // Electron's dom_storage_limits.patch increased this value from 10MiB to 100MiB
|
|
|
|
+ const uint32 kPerStorageAreaQuota = 104857600; // 100 MiB
|
2019-01-11 19:48:27 +00:00
|
|
|
|
2019-11-22 19:35:54 +00:00
|
|
|
// In the browser process we allow some overage to
|
|
|
|
// accommodate concurrent writes from different renderers
|