.: REGRESSION (r39725?): Resources removed from document can not be freed until the...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Aug 2011 21:22:08 +0000 (21:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Aug 2011 21:22:08 +0000 (21:22 +0000)
commit789daba39e2e1a861b1790b081cd83036d391501
treeb966dc7e4aa92a8753f7e76290d5006c8a272e28
parent34be522ca1f6ef0b8563220ae71292fe84946ba2
.: REGRESSION (r39725?): Resources removed from document can not be freed until the document is deleted
https://bugs.webkit.org/show_bug.cgi?id=61006

Patch by Scott Graham <scottmg@chromium.org> on 2011-08-01
Reviewed by Antti Koivisto.

Update exports for test harness.

* Source/autotools/symbols.filter:

Source/WebCore: REGRESSION (r39725?): Resources removed from document can not be freed
until the document is deleted
https://bugs.webkit.org/show_bug.cgi?id=61006

Patch by Scott Graham <scottmg@chromium.org> on 2011-08-01
Reviewed by Antti Koivisto.

Upon completing a load start a Timer to iterate through
CachedResourceLoader's m_documentResources map to check for any items
that have only one reference (thus being the reference in the map
itself). The map should really be weak, but because the
CachedResourceHandle achieves bookkeeping work in addition to
reference counting, this is a simpler and more localized way to free
the used memory while maintaining the other behaviour (when
CachedResource is used as proxy).

With this patch the testcase at
https://bugs.webkit.org/attachment.cgi?id=93850 should no longer
consume 400MB of ram on load. Test added for crash discovered in
previous revision, but no tests for memory usage.

Test: http/tests/inspector/network/disabled-cache-crash.html

* WebCore.exp.in:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::hasOneHandle):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::CachedResourceLoader):
(WebCore::CachedResourceLoader::loadDone):
(WebCore::CachedResourceLoader::garbageCollectDocumentResourcesTimerFired):
* loader/cache/CachedResourceLoader.h:
* testing/Internals.cpp:
(WebCore::Internals::disableMemoryCache):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2: REGRESSION (r39725?): Resources removed from document can not be freed until the document is deleted
https://bugs.webkit.org/show_bug.cgi?id=61006

Patch by Scott Graham <scottmg@chromium.org> on 2011-08-01
Reviewed by Antti Koivisto.

Update exports for test harness.

* win/WebKit2.def:
* win/WebKit2CFLite.def:

LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=61006

Test for CachedResourceLoader. Not caused by cache-disabling but very
difficult to reproduce when cache is active, so use cache disable in
inspector to exercise code.

Patch by Scott Graham <scottmg@chromium.org> on 2011-08-01
Reviewed by Antti Koivisto.

* http/tests/inspector/network/disabled-cache-crash-expected.txt: Added.
* http/tests/inspector/network/disabled-cache-crash.html: Added.
* platform/gtk/Skipped:
* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/network/disabled-cache-crash-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/disabled-cache-crash.html [new file with mode: 0644]
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/CachedResourceLoader.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit2/ChangeLog
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def
Source/autotools/symbols.filter