8000 Implement StorageManager.estimate() · WebKit/WebKit@a793d8b · GitHub
[go: up one dir, main page]

Skip to content

Commit a793d8b

Browse files
committed
Implement StorageManager.estimate()
https://bugs.webkit.org/show_bug.cgi?id=248918 rdar://problem/103380414 Reviewed by Chris Dumez. Spec: https://storage.spec.whatwg.org/#dom-storagemanager-estimate * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-application-cache.https.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/opaque-origin.https.window-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.worker-expected.txt: * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/Headers.cmake: * Source/WebCore/Modules/storage/DummyStorageProvider.h: * Source/WebCore/Modules/storage/StorageConnection.h: * Source/WebCore/Modules/storage/StorageEstimate.h: Copied from Source/WebCore/Modules/storage/StorageManager.idl. (WebCore::StorageEstimate::isolatedCopy const): * Source/WebCore/Modules/storage/StorageManager.cpp: (WebCore::StorageManager::estimate): * Source/WebCore/Modules/storage/StorageManager.h: * Source/WebCore/Modules/storage/StorageManager.idl: * Source/WebCore/Modules/storage/WorkerStorageConnection.cpp: (WebCore::WorkerStorageConnection::getEstimate): (WebCore::WorkerStorageConnection::didGetEstimate): * Source/WebCore/Modules/storage/WorkerStorageConnection.h: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::estimate): * Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h: * Source/WebKit/NetworkProcess/storage/NetworkStorageManager.messages.in: * Source/WebKit/NetworkProcess/storage/OriginStorageManager.cpp: (WebKit::OriginStorageManager::estimate): * Source/WebKit/NetworkProcess/storage/OriginStorageManager.h: * Source/WebKit/NetworkProcess/storage/QuotaManager.cpp: (WebKit::QuotaManager::usage): * Source/WebKit/NetworkProcess/storage/QuotaManager.h: (WebKit::QuotaManager::quota const): * Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in: * Source/WebKit/WebProcess/WebCoreSupport/WebStorageConnection.cpp: (WebKit::WebStorageConnection::getEstimate): * Source/WebKit/WebProcess/WebCoreSupport/WebStorageConnection.h: Canonical link: https://commits.webkit.org/258610@main
1 parent f180b7a commit a793d8b

File tree

38 files changed

+196
-32
lines changed

38 files changed

+196
-32
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
FAIL estimate() method exists and returns a Promise assert_true: expected true got false
3-
FAIL estimate() resolves to dictionary with members promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
4-
FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
2+
PASS estimate() method exists and returns a Promise
3+
PASS estimate() resolves to dictionary with members
4+
PASS estimate() shows usage increase after large value is stored
55

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
FAIL estimate() method exists and returns a Promise assert_true: expected true got false
3-
FAIL estimate() resolves to dictionary with members promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
4-
FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
2+
PASS estimate() method exists and returns a Promise
3+
PASS estimate() resolves to dictionary with members
4+
PASS estimate() shows usage increase after large value is stored
55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
FAIL Multiple estimate() calls in parallel should complete promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
2+
PASS Multiple estimate() calls in parallel should complete
33

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
FAIL Multiple estimate() calls in parallel should complete promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
2+
PASS Multiple estimate() calls in parallel should complete
33

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
FAIL estimate() shows usage increase after app is cached promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
2+
FAIL estimate() shows usage increase after app is cached promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'estimate.usageDetails.applicationCache')"
33

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
2+
FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'estimate.usageDetails.caches')"
33

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
2+
FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'estimate.usageDetails.caches')"
33

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

2-
FAIL estimate() resolves to dictionary with usageDetails member promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
3-
FAIL estimate() usage details reflects increase in indexedDB after large value is stored promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
2+
FAIL estimate() resolves to dictionary with usageDetails member assert_equals: expected "object" but got "undefined"
3+
FAIL estimate() usage details reflects increase in indexedDB after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'estimate.usageDetails.indexedDB')"
44

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

2-
FAIL estimate() resolves to dictionary with usageDetails member promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
3-
FAIL estimate() usage details reflects increase in indexedDB after large value is stored promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
2+
FAIL estimate() resolves to dictionary with usageDetails member assert_equals: expected "object" but got "undefined"
3+
FAIL estimate() usage details reflects increase in indexedDB after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'estimate.usageDetails.indexedDB')"
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: navigator.storage.estimate is not a function. (In 'navigator.storage.estimate()', 'navigator.storage.estimate' is undefined)"
2+
FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'estimate.usageDetails.serviceWorkerRegistrations')"
33

0 commit comments

Comments
 (0)
0