Diff
Modified: trunk/Source/WebCore/ChangeLog (251030 => 251031)
--- trunk/Source/WebCore/ChangeLog 2019-10-11 23:47:44 UTC (rev 251030)
+++ trunk/Source/WebCore/ChangeLog 2019-10-12 00:12:01 UTC (rev 251031)
@@ -1,5 +1,24 @@
2019-10-11 Chris Dumez <cdu...@apple.com>
+ API Test TestWebKitAPI.WebKit.DefaultQuota is very flaky on High Sierra
+ https://bugs.webkit.org/show_bug.cgi?id=202850
+
+ Reviewed by Alex Christensen.
+
+ Make sure the DOMCache / DOMCacheStorage objects stay alive while they have pending
+ promises to be resolved.
+
+ * Modules/cache/DOMCache.cpp:
+ (WebCore::DOMCache::hasPendingActivity const):
+ * Modules/cache/DOMCache.h:
+ * Modules/cache/DOMCache.idl:
+ * Modules/cache/DOMCacheStorage.cpp:
+ (WebCore::DOMCacheStorage::hasPendingActivity const):
+ * Modules/cache/DOMCacheStorage.h:
+ * Modules/cache/DOMCacheStorage.idl:
+
+2019-10-11 Chris Dumez <cdu...@apple.com>
+
Unreviewed, address post-landing feedback from Darin for r251019.
Added a new comment for clarity.
Modified: trunk/Source/WebCore/Modules/cache/DOMCache.cpp (251030 => 251031)
--- trunk/Source/WebCore/Modules/cache/DOMCache.cpp 2019-10-11 23:47:44 UTC (rev 251030)
+++ trunk/Source/WebCore/Modules/cache/DOMCache.cpp 2019-10-12 00:12:01 UTC (rev 251031)
@@ -613,5 +613,10 @@
return true;
}
+bool DOMCache::hasPendingActivity() const
+{
+ return m_taskQueue->hasPendingTasks() || ActiveDOMObject::hasPendingActivity();
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/cache/DOMCache.h (251030 => 251031)
--- trunk/Source/WebCore/Modules/cache/DOMCache.h 2019-10-11 23:47:44 UTC (rev 251030)
+++ trunk/Source/WebCore/Modules/cache/DOMCache.h 2019-10-12 00:12:01 UTC (rev 251031)
@@ -63,6 +63,9 @@
CacheStorageConnection& connection() { return m_connection.get(); }
+ // ActiveDOMObject
+ bool hasPendingActivity() const final;
+
private:
DOMCache(ScriptExecutionContext&, String&& name, uint64_t identifier, Ref<CacheStorageConnection>&&);
Modified: trunk/Source/WebCore/Modules/cache/DOMCache.idl (251030 => 251031)
--- trunk/Source/WebCore/Modules/cache/DOMCache.idl 2019-10-11 23:47:44 UTC (rev 251030)
+++ trunk/Source/WebCore/Modules/cache/DOMCache.idl 2019-10-12 00:12:01 UTC (rev 251031)
@@ -26,6 +26,7 @@
typedef (FetchRequest or USVString) RequestInfo;
[
+ ActiveDOMObject,
SecureContext,
Exposed=(Window,Worker),
EnabledAtRuntime=CacheAPI,
Modified: trunk/Source/WebCore/Modules/cache/DOMCacheStorage.cpp (251030 => 251031)
--- trunk/Source/WebCore/Modules/cache/DOMCacheStorage.cpp 2019-10-11 23:47:44 UTC (rev 251030)
+++ trunk/Source/WebCore/Modules/cache/DOMCacheStorage.cpp 2019-10-12 00:12:01 UTC (rev 251031)
@@ -293,4 +293,9 @@
return true;
}
+bool DOMCacheStorage::hasPendingActivity() const
+{
+ return m_taskQueue->hasPendingTasks() || ActiveDOMObject::hasPendingActivity();
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/cache/DOMCacheStorage.h (251030 => 251031)
--- trunk/Source/WebCore/Modules/cache/DOMCacheStorage.h 2019-10-11 23:47:44 UTC (rev 251030)
+++ trunk/Source/WebCore/Modules/cache/DOMCacheStorage.h 2019-10-12 00:12:01 UTC (rev 251031)
@@ -47,6 +47,9 @@
void remove(const String&, DOMPromiseDeferred<IDLBoolean>&&);
void keys(KeysPromise&&);
+ // ActiveDOMObject
+ bool hasPendingActivity() const final;
+
private:
DOMCacheStorage(ScriptExecutionContext&, Ref<CacheStorageConnection>&&);
Modified: trunk/Source/WebCore/Modules/cache/DOMCacheStorage.idl (251030 => 251031)
--- trunk/Source/WebCore/Modules/cache/DOMCacheStorage.idl 2019-10-11 23:47:44 UTC (rev 251030)
+++ trunk/Source/WebCore/Modules/cache/DOMCacheStorage.idl 2019-10-12 00:12:01 UTC (rev 251031)
@@ -26,6 +26,7 @@
typedef (FetchRequest or USVString) RequestInfo;
[
+ ActiveDOMObject,
SecureContext,
Exposed=(Window,Worker),
EnabledAtRuntime=CacheAPI,