-
rdar://problem/10917120https://bugs.webkit.org/show_bug.cgi?id=81066beidson@apple.com authored
Crash in 3rd party WebKit apps under XHR/Cache code Reviewed by Antti Koivisto. Source/WebCore: No new layout tests. TestWebKitAPI test MemoryCachePruneWithinResourceLoadDelegate included A CachedResource representing an XHR was being deleted by cache pruning during a delegate callback. This worked until http://trac.webkit.org/changeset/98380 * history/PageCache.cpp: (WebCore::PageCache::releaseAutoreleasedPagesNow): Only trigger pruning after the page cache autorelease if it was enabled before. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::loadResource): Disable pruning before loading the resource and re-enable it afterwards if necessary. * loader/cache/MemoryCache.h: (WebCore::MemoryCache::pruneEnabled): Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/mac/MemoryCachePruneWithinResourceLoadDelegate.html: Added. * TestWebKitAPI/Tests/mac/MemoryCachePruneWithinResourceLoadDelegate.mm: Added. (-[MemoryCachePruneTestResourceLoadDelegate webView:identifierForInitialRequest:fromDataSource:]): (-[MemoryCachePruneTestResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]): (-[MemoryCachePruneTestResourceLoadDelegate webView:resource:didFinishLoadingFromDataSource:]): (-[MemoryCachePruneTestResourceLoadDelegate webView:resource:didFailLoadingWithError:fromDataSource:]): (TestWebKitAPI): (TestWebKitAPI::TEST): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@111272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
0d319b74