Changeset 92143 in webkit
- Timestamp:
- Aug 1, 2011, 2:22:08 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 18 edited
-
ChangeLog (modified) (1 diff)
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/inspector/network/disabled-cache-crash-expected.txt (added)
-
LayoutTests/http/tests/inspector/network/disabled-cache-crash.html (added)
-
LayoutTests/platform/gtk/Skipped (modified) (1 diff)
-
LayoutTests/platform/mac/Skipped (modified) (1 diff)
-
LayoutTests/platform/qt/Skipped (modified) (1 diff)
-
LayoutTests/platform/win/Skipped (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/WebCore.exp.in (modified) (1 diff)
-
Source/WebCore/loader/cache/CachedResource.h (modified) (1 diff)
-
Source/WebCore/loader/cache/CachedResourceLoader.cpp (modified) (2 diffs)
-
Source/WebCore/loader/cache/CachedResourceLoader.h (modified) (3 diffs)
-
Source/WebCore/testing/Internals.cpp (modified) (2 diffs)
-
Source/WebCore/testing/Internals.h (modified) (1 diff)
-
Source/WebCore/testing/Internals.idl (modified) (1 diff)
-
Source/WebKit2/ChangeLog (modified) (1 diff)
-
Source/WebKit2/win/WebKit2.def (modified) (1 diff)
-
Source/WebKit2/win/WebKit2CFLite.def (modified) (1 diff)
-
Source/autotools/symbols.filter (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r92124 r92143 1 2011-08-01 Scott Graham <scottmg@chromium.org> 2 3 REGRESSION (r39725?): Resources removed from document can not be freed until the document is deleted 4 https://bugs.webkit.org/show_bug.cgi?id=61006 5 6 Reviewed by Antti Koivisto. 7 8 Update exports for test harness. 9 10 * Source/autotools/symbols.filter: 11 1 12 2011-08-01 Hayato Ito <hayato@chromium.org> 2 13 -
trunk/LayoutTests/ChangeLog
r92142 r92143 1 2011-08-01 Scott Graham <scottmg@chromium.org> 2 3 https://bugs.webkit.org/show_bug.cgi?id=61006 4 5 Test for CachedResourceLoader. Not caused by cache-disabling but very 6 difficult to reproduce when cache is active, so use cache disable in 7 inspector to exercise code. 8 9 Reviewed by Antti Koivisto. 10 11 * http/tests/inspector/network/disabled-cache-crash-expected.txt: Added. 12 * http/tests/inspector/network/disabled-cache-crash.html: Added. 13 * platform/gtk/Skipped: 14 * platform/mac/Skipped: 15 * platform/qt/Skipped: 16 * platform/win/Skipped: 17 1 18 2011-08-01 Jochen Eisinger <jochen@chromium.org> 2 19 -
trunk/LayoutTests/platform/gtk/Skipped
r92141 r92143 1461 1461 http/tests/inspector/network/network-disable-cache-memory.html 1462 1462 http/tests/inspector/network/network-disable-cache-xhrs.html 1463 http/tests/inspector/network/disabled-cache-crash.html 1463 1464 1464 1465 # https://bugs.webkit.org/show_bug.cgi?id=61437 -
trunk/LayoutTests/platform/mac/Skipped
r92141 r92143 333 333 http/tests/inspector/network/network-disable-cache-memory.html 334 334 http/tests/inspector/network/network-disable-cache-xhrs.html 335 http/tests/inspector/network/disabled-cache-crash.html 335 336 336 337 # https://bugs.webkit.org/show_bug.cgi?id=58515 -
trunk/LayoutTests/platform/qt/Skipped
r92141 r92143 1858 1858 http/tests/inspector/network/network-disable-cache-memory.html 1859 1859 http/tests/inspector/network/network-disable-cache-xhrs.html 1860 http/tests/inspector/network/disabled-cache-crash.html 1860 1861 1861 1862 # [Qt] media/video-playbackrate.html fails -
trunk/LayoutTests/platform/win/Skipped
r92141 r92143 56 56 http/tests/inspector/network/network-disable-cache-memory.html 57 57 http/tests/inspector/network/network-disable-cache-xhrs.html 58 http/tests/inspector/network/disabled-cache-crash.html 58 59 59 60 # Fails <rdar://problem/5674289> -
trunk/Source/WebCore/ChangeLog
r92142 r92143 1 2011-08-01 Scott Graham <scottmg@chromium.org> 2 3 REGRESSION (r39725?): Resources removed from document can not be freed 4 until the document is deleted 5 https://bugs.webkit.org/show_bug.cgi?id=61006 6 7 Reviewed by Antti Koivisto. 8 9 Upon completing a load start a Timer to iterate through 10 CachedResourceLoader's m_documentResources map to check for any items 11 that have only one reference (thus being the reference in the map 12 itself). The map should really be weak, but because the 13 CachedResourceHandle achieves bookkeeping work in addition to 14 reference counting, this is a simpler and more localized way to free 15 the used memory while maintaining the other behaviour (when 16 CachedResource is used as proxy). 17 18 With this patch the testcase at 19 https://bugs.webkit.org/attachment.cgi?id=93850 should no longer 20 consume 400MB of ram on load. Test added for crash discovered in 21 previous revision, but no tests for memory usage. 22 23 Test: http/tests/inspector/network/disabled-cache-crash.html 24 25 * WebCore.exp.in: 26 * loader/cache/CachedResource.h: 27 (WebCore::CachedResource::hasOneHandle): 28 * loader/cache/CachedResourceLoader.cpp: 29 (WebCore::CachedResourceLoader::CachedResourceLoader): 30 (WebCore::CachedResourceLoader::loadDone): 31 (WebCore::CachedResourceLoader::garbageCollectDocumentResourcesTimerFired): 32 * loader/cache/CachedResourceLoader.h: 33 * testing/Internals.cpp: 34 (WebCore::Internals::disableMemoryCache): 35 * testing/Internals.h: 36 * testing/Internals.idl: 37 1 38 2011-08-01 Jochen Eisinger <jochen@chromium.org> 2 39 -
trunk/Source/WebCore/WebCore.exp.in
r92124 r92143 218 218 __ZN7WebCore11MemoryCache19getOriginsWithCacheERN3WTF7HashSetINS1_6RefPtrINS_14SecurityOriginEEENS_18SecurityOriginHashENS1_10HashTraitsIS5_EEEE 219 219 __ZN7WebCore11MemoryCache25removeResourcesWithOriginEPNS_14SecurityOriginE 220 __ZN7WebCore11MemoryCache11setDisabledEb 220 221 __ZN7WebCore11RenderLayer19scrollRectToVisibleERKNS_7IntRectERKNS_15ScrollAlignmentES6_ 221 222 __ZN7WebCore11globalPointERK8_NSPointP8NSWindow -
trunk/Source/WebCore/loader/cache/CachedResource.h
r91725 r92143 183 183 184 184 bool canDelete() const { return !hasClients() && !m_request && !m_preloadCount && !m_handleCount && !m_resourceToRevalidate && !m_proxyResource; } 185 bool hasOneHandle() const { return m_handleCount == 1; } 185 186 186 187 bool isExpired() const; -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r91725 r92143 87 87 : m_document(document) 88 88 , m_requestCount(0) 89 , m_garbageCollectDocumentResourcesTimer(this, &CachedResourceLoader::garbageCollectDocumentResourcesTimerFired) 89 90 , m_autoLoadImages(true) 90 91 , m_loadFinishing(false) … … 573 574 frame()->loader()->loadDone(); 574 575 performPostLoadActions(); 576 577 if (!m_garbageCollectDocumentResourcesTimer.isActive()) 578 m_garbageCollectDocumentResourcesTimer.startOneShot(0); 579 } 580 581 // Garbage collecting m_documentResources is a workaround for the 582 // CachedResourceHandles on the RHS being strong references. Ideally this 583 // would be a weak map, however CachedResourceHandles perform additional 584 // bookkeeping on CachedResources, so instead pseudo-GC them -- when the 585 // reference count reaches 1, m_documentResources is the only reference, so 586 // remove it from the map. 587 void CachedResourceLoader::garbageCollectDocumentResourcesTimerFired(Timer<CachedResourceLoader>* timer) 588 { 589 ASSERT_UNUSED(timer, timer == &m_garbageCollectDocumentResourcesTimer); 590 591 typedef Vector<String, 10> StringVector; 592 StringVector resourcesToDelete; 593 594 for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != m_documentResources.end(); ++it) { 595 if (it->second->hasOneHandle()) { 596 resourcesToDelete.append(it->first); 597 it->second->setOwningCachedResourceLoader(0); 598 } 599 } 600 601 for (StringVector::const_iterator it = resourcesToDelete.begin(); it != resourcesToDelete.end(); ++it) 602 m_documentResources.remove(*it); 575 603 } 576 604 -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.h
r91725 r92143 31 31 #include "CachePolicy.h" 32 32 #include "ResourceLoadPriority.h" 33 #include "Timer.h" 33 34 #include <wtf/Deque.h> 34 35 #include <wtf/HashMap.h> … … 118 119 bool canRequest(CachedResource::Type, const KURL&, bool forPreload = false); 119 120 121 void garbageCollectDocumentResourcesTimerFired(Timer<CachedResourceLoader>*); 120 122 void performPostLoadActions(); 121 123 … … 133 135 }; 134 136 Deque<PendingPreload> m_pendingPreloads; 137 138 Timer<CachedResourceLoader> m_garbageCollectDocumentResourcesTimer; 135 139 136 140 //29 bits left -
trunk/Source/WebCore/testing/Internals.cpp
r92124 r92143 33 33 #include "ExceptionCode.h" 34 34 #include "InspectorController.h" 35 #include "MemoryCache.h" 35 36 #include "NodeRenderingContext.h" 36 37 #include "Page.h" … … 148 149 } 149 150 151 void Internals::disableMemoryCache(bool disabled) 152 { 153 WebCore::memoryCache()->setDisabled(disabled); 154 } 155 150 156 #if ENABLE(INSPECTOR) 151 157 void Internals::setInspectorResourcesDataSizeLimits(Document* document, int maximumResourcesContentSize, int maximumSingleResourceContentSize, ExceptionCode& ec) -
trunk/Source/WebCore/testing/Internals.h
r92124 r92143 56 56 PassRefPtr<Element> createShadowContentElement(Document*, ExceptionCode&); 57 57 Element* getElementByIdInShadowRoot(Node* shadowRoot, const String& id, ExceptionCode&); 58 void disableMemoryCache(bool disabled); 58 59 59 60 #if ENABLE(INSPECTOR) -
trunk/Source/WebCore/testing/Internals.idl
r92124 r92143 38 38 Element createShadowContentElement(in Document document) raises(DOMException); 39 39 Element getElementByIdInShadowRoot(in Node shadowRoot, in DOMString id) raises(DOMException); 40 void disableMemoryCache(in boolean disabled); 40 41 41 42 void setInspectorResourcesDataSizeLimits(in Document document, in long maximumResourcesContentSize, in long maximumSingleResourceContentSize) raises(DOMException); -
trunk/Source/WebKit2/ChangeLog
r92124 r92143 1 2011-08-01 Scott Graham <scottmg@chromium.org> 2 3 REGRESSION (r39725?): Resources removed from document can not be freed until the document is deleted 4 https://bugs.webkit.org/show_bug.cgi?id=61006 5 6 Reviewed by Antti Koivisto. 7 8 Update exports for test harness. 9 10 * win/WebKit2.def: 11 * win/WebKit2CFLite.def: 12 1 13 2011-08-01 Hayato Ito <hayato@chromium.org> 2 14 -
trunk/Source/WebKit2/win/WebKit2.def
r92124 r92143 155 155 ?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z 156 156 ?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z 157 ?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ 157 158 ?page@Document@WebCore@@QBEPAVPage@2@XZ 158 159 ?removeShadowRoot@Element@WebCore@@QAEXXZ 160 ?setDisabled@MemoryCache@WebCore@@QAEX_N@Z 159 161 ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z 160 162 ?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z -
trunk/Source/WebKit2/win/WebKit2CFLite.def
r92124 r92143 149 149 ?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ 150 150 ?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z 151 ?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ 151 152 ?page@Document@WebCore@@QBEPAVPage@2@XZ 152 153 ?removeShadowRoot@Element@WebCore@@QAEXXZ 154 ?setDisabled@MemoryCache@WebCore@@QAEX_N@Z 153 155 ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z 154 156 ?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z -
trunk/Source/autotools/symbols.filter
r92124 r92143 36 36 _ZN7WebCore11EventTarget17toGeneratedStreamEv; 37 37 _ZN7WebCore11EventTarget8toStreamEv; 38 _ZN7WebCore11MemoryCache11setDisabledEb; 39 _ZN7WebCore11memoryCacheEv; 38 40 _ZN7WebCore12JSDOMWrapper34virtualFunctionToPreventWeakVtableEv; 39 41 _ZN7WebCore12RenderObject23absoluteBoundingBoxRectEb;
Note:
See TracChangeset
for help on using the changeset viewer.