From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jacob Quant Date: Thu, 31 Oct 2019 14:00:00 -0500 Subject: dom_storage_limits.patch 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). 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. diff --git a/components/services/storage/dom_storage/dom_storage_constants.cc b/components/services/storage/dom_storage/dom_storage_constants.cc index 3fd108c89c3b070a08790850db4dfd6cc8a3ce44..c393f51709efd8b28b07edfe452d2b84b14983ae 100644 --- 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 { -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; + const size_t kPerStorageAreaOverQuotaAllowance = 100 * 1024; } // namespace storage diff --git a/third_party/blink/public/mojom/dom_storage/storage_area.mojom b/third_party/blink/public/mojom/dom_storage/storage_area.mojom index adbb73ef9c5a5a59fd0bfe0137d0dc9219d376e9..7e1e10faba4263d8ec1afefdebb3202da1944d34 100644 --- a/third_party/blink/public/mojom/dom_storage/storage_area.mojom +++ b/third_party/blink/public/mojom/dom_storage/storage_area.mojom @@ -50,7 +50,8 @@ struct KeyValue { 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 // In the browser process we allow some overage to // accommodate concurrent writes from different renderers