WebKit Bugzilla
Attachment 349312 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-20180910090242.patch (text/plain), 4.91 KB, created by
Simon Fraser (smfr)
on 2018-09-10 09:02:42 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2018-09-10 09:02:42 PDT
Size:
4.91 KB
patch
obsolete
>Subversion Revision: 235849 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 5e1d80440e87fff446bb07873d8f8966bbf95735..227da75afaca95c039f5f32064a52f96777e6fa8 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-10 Fujii Hironori <Hironori.Fujii@sony.com> > > [MSVC] X86Assembler.h(108): error C2666: 'WebCore::operator -': 7 overloads have similar conversions >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >index 1a32c605f5f2b713b6430309e1dee833318311ee..7f74f7e076ad293deeb23d305f31fa9824789f2a 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >@@ -44,8 +44,7 @@ > #include "WebPage.h" > #include "WebPageGroupProxy.h" > #include <WebCore/DatabaseTracker.h> >-#include <WebCore/MemoryCache.h> >-#include <WebCore/PageCache.h> >+#include <WebCore/MemoryRelease.h> > #include <WebCore/ResourceLoadObserver.h> > #include <WebCore/ServiceWorkerThreadProxy.h> > >@@ -260,14 +259,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 3949f77b6c91fca4a027a44b7b43277a2cef371b..ecf329d445a3f89c68e7018c2445296b60c32051 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h >@@ -98,8 +98,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 80e5b8e482c19c9e5d5b1ec6955d71c28922ec40..25083c4c2c2fba4ae1d74a95604cb5a5b4f891e2 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-09 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r235832. >diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >index 6113b76e1b650ef009773b0b005797b2e23ad7db..72a057fd02c43f8bc99c7f78a58d26e53e84e74b 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >@@ -271,9 +271,7 @@ void InjectedBundle::didReceiveMessageToPage(WKBundlePageRef page, WKStringRef m > } > > if (WKStringIsEqualToUTF8CString(messageName, "CheckForWorldLeaks")) { >- 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