WebKit Bugzilla
Attachment 349281 Details for
Bug 189459
: Before tracking Document leaks, clear all caches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189459-20180908205958.patch (text/plain), 4.97 KB, created by
Simon Fraser (smfr)
on 2018-09-08 20:59:59 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2018-09-08 20:59:59 PDT
Size:
4.97 KB
patch
obsolete
>Subversion Revision: 235830 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 0213c9b8d2cc94c1b85cf3e4c17a4ead77068a2b..093631b162b39bc6ebb2fb2e628694428578817d 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2018-09-08 Simon Fraser <simon.fraser@apple.com> >+ >+ Before tracking Document leaks, clear all caches >+ https://bugs.webkit.org/show_bug.cgi?id=189459 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ It's not enough to clear the page and memory caches; font caches can reference Documents (for SVG fonts), >+ so just call WebCore::releaseMemory(), which empties caches including the page and memory caches, and >+ does the GC that we need to happen. >+ >+ * WebProcess/InjectedBundle/API/c/WKBundle.cpp: >+ (WKBundleReleaseMemory): >+ (WKBundleClearPageCache): Deleted. >+ (WKBundleClearMemoryCache): Deleted. >+ * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: >+ > 2018-09-08 Simon Fraser <simon.fraser@apple.com> > > Make it possible to track unbalanced ref()/deref() >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >index 1b29f0b06a23caca797d04b91bdab351fa1d4121..bea1226d3b8ed79f83685f2515bfec96940688b4 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >@@ -46,6 +46,7 @@ > #include <WebCore/DatabaseTracker.h> > #include <WebCore/GCController.h> > #include <WebCore/MemoryCache.h> >+#include <WebCore/MemoryRelease.h> > #include <WebCore/PageCache.h> > #include <WebCore/ResourceLoadObserver.h> > #include <WebCore/ServiceWorkerThreadProxy.h> >@@ -266,14 +267,9 @@ void WKBundleSetDatabaseQuota(WKBundleRef bundleRef, uint64_t quota) > DatabaseTracker::singleton().setQuota(*SecurityOriginData::fromDatabaseIdentifier("file__0"), quota); > } > >-void WKBundleClearPageCache(WKBundleRef bundle) >+void WKBundleReleaseMemory(WKBundleRef) > { >- PageCache::singleton().pruneToSizeNow(0, PruningReason::MemoryPressure); >-} >- >-void WKBundleClearMemoryCache(WKBundleRef bundle) >-{ >- MemoryCache::singleton().evictResources(); >+ WebCore::releaseMemory(WTF::Critical::Yes, WTF::Synchronous::Yes); > } > > WKDataRef WKBundleCreateWKDataFromUInt8Array(WKBundleRef bundle, JSContextRef context, JSValueRef data) >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h >index a4bfcd6210c25da20fc86510b57da85d33bb49ab..8f3fc785026d9791784ed3888cb0e682df71c967 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h >@@ -100,8 +100,7 @@ WK_EXPORT void WKBundleResourceLoadStatisticsNotifyObserver(WKBundleRef); > > WK_EXPORT void WKBundleExtendClassesForParameterCoder(WKBundleRef bundle, WKArrayRef classes); > >-WK_EXPORT void WKBundleClearPageCache(WKBundleRef bundle); >-WK_EXPORT void WKBundleClearMemoryCache(WKBundleRef bundle); >+WK_EXPORT void WKBundleReleaseMemory(WKBundleRef); > > #ifdef __cplusplus > } >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 3ce40a691b5af0702818fe30bc626f44d8cbffec..598254356957f5feb6d72ae14840e744f3598084 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,17 @@ >+2018-09-08 Simon Fraser <simon.fraser@apple.com> >+ >+ Before tracking Document leaks, clear all caches >+ https://bugs.webkit.org/show_bug.cgi?id=189459 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ It's not enough to clear the page and memory caches; font caches can reference Documents (for SVG fonts), >+ so just call WebCore::releaseMemory(), which empties caches including the page and memory caches, and >+ does the GC that we need to happen. >+ >+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: >+ (WTR::InjectedBundle::didReceiveMessageToPage): >+ > 2018-09-08 Simon Fraser <simon.fraser@apple.com> > > accessibility/notification-listeners.html abandons a document >diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >index ddd197cdc14cb6275c83cb8dd7cceb06aec2de40..692fb85a512fc2d5c1e45234bff06c1d0846e36f 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >@@ -284,9 +284,7 @@ void InjectedBundle::didReceiveMessageToPage(WKBundlePageRef page, WKStringRef m > m_dumpHeapShapshotAfterFetchingLiveDocuments = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, dumpSnapshotKey.get()))); > } > >- WKBundleClearPageCache(m_bundle); >- WKBundleClearMemoryCache(m_bundle); >- WKBundleGarbageCollectJavaScriptObjects(m_bundle); >+ WKBundleReleaseMemory(m_bundle); > > WKRetain(page); // Balanced by the release in postGCTask. > WKBundlePagePostTask(page, postGCTask, (void*)page);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189459
:
349281
|
349312