Changeset 39474 in webkit
- Timestamp:
- Dec 25, 2008 1:12:07 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r39469 r39474 1 2008-12-25 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 https://bugs.webkit.org/show_bug.cgi?id=22993 6 Application cache shouldn't be inherited by subframes 7 8 <rdar://problem/6284708> AppCache crashes in ApplicationCacheResource::addType() 9 10 * http/tests/appcache/foreign-iframe-main-expected.txt: Added. 11 * http/tests/appcache/foreign-iframe-main.html: Added. 12 * http/tests/appcache/resources/foreign-iframe-subresource.js: Added. 13 * http/tests/appcache/resources/foreign-iframe.html: Added. 14 * http/tests/appcache/resources/foreign-iframe.manifest: Added. 15 1 16 2008-12-24 Simon Fraser <simon.fraser@apple.com> 2 17 -
trunk/WebCore/ChangeLog
r39473 r39474 1 2008-12-25 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 https://bugs.webkit.org/show_bug.cgi?id=22993 6 Application cache shouldn't be inherited by subframes 7 8 <rdar://problem/6284708> AppCache crashes in ApplicationCacheResource::addType() 9 This crash happened because main resource for subframe was looked up in top frame's 10 appcache. If not for the spec change, it could have been fixed by preventing the load 11 altogether. 12 13 Test: http/tests/appcache/foreign-iframe-main.html 14 I intend to write additional tests for the behavior change. 15 16 * loader/DocumentLoader.cpp: 17 (WebCore::DocumentLoader::shouldLoadResourceFromApplicationCache): 18 * loader/DocumentLoader.h: 19 (WebCore::DocumentLoader::applicationCache): 20 * loader/MainResourceLoader.cpp: 21 (WebCore::MainResourceLoader::load): 22 * loader/appcache/DOMApplicationCache.cpp: 23 (WebCore::DOMApplicationCache::associatedCache): 24 Removed DocumentLoader::topLevelApplicationCache(), and changed callers accordingly. 25 26 * loader/appcache/ApplicationCacheGroup.cpp: 27 (WebCore::ApplicationCacheGroup::selectCache): 28 (WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL): 29 Removed checks for the frame being top-level one, now that subframes are cached independently. 30 1 31 2008-12-25 Antti Koivisto <antti@apple.com> 2 32 -
trunk/WebCore/loader/DocumentLoader.cpp
r39304 r39474 853 853 } 854 854 855 ApplicationCache* DocumentLoader::topLevelApplicationCache() const856 {857 if (!m_frame)858 return 0;859 860 if (m_applicationCache)861 return m_applicationCache.get();862 863 if (Page* page = m_frame->page())864 return page->mainFrame()->loader()->documentLoader()->applicationCache();865 866 return 0;867 }868 869 855 ApplicationCache* DocumentLoader::mainResourceApplicationCache() const 870 856 { … … 878 864 bool DocumentLoader::shouldLoadResourceFromApplicationCache(const ResourceRequest& request, ApplicationCacheResource*& resource) 879 865 { 880 ApplicationCache* cache = topLevelApplicationCache();866 ApplicationCache* cache = applicationCache(); 881 867 if (!cache) 882 868 return false; -
trunk/WebCore/loader/DocumentLoader.h
r38728 r39474 206 206 void setApplicationCache(PassRefPtr<ApplicationCache> applicationCache); 207 207 ApplicationCache* applicationCache() const { return m_applicationCache.get(); } 208 ApplicationCache* topLevelApplicationCache() const;209 208 210 209 ApplicationCache* mainResourceApplicationCache() const; -
trunk/WebCore/loader/MainResourceLoader.cpp
r39432 r39474 434 434 ASSERT(!m_applicationCache); 435 435 436 if (Page* page = frameLoader()->frame()->page()) { 437 if (frameLoader()->frame() == page->mainFrame()) 438 m_applicationCache = ApplicationCacheGroup::cacheForMainRequest(r, m_documentLoader.get()); 439 else 440 m_applicationCache = frameLoader()->documentLoader()->topLevelApplicationCache(); 441 } 436 m_applicationCache = ApplicationCacheGroup::cacheForMainRequest(r, m_documentLoader.get()); 442 437 443 438 if (m_applicationCache) { -
trunk/WebCore/loader/appcache/ApplicationCacheGroup.cpp
r39437 r39474 113 113 ApplicationCache* mainResourceCache = documentLoader->mainResourceApplicationCache(); 114 114 115 // Check if the main resource is being loaded as part of navigation of the main frame116 bool isMainFrame = frame->page()->mainFrame() == frame;117 118 if (!isMainFrame) {119 if (mainResourceCache && manifestURL != mainResourceCache->group()->manifestURL()) {120 ApplicationCacheResource* resource = mainResourceCache->resourceForURL(documentLoader->originalURL());121 ASSERT(resource);122 123 resource->addType(ApplicationCacheResource::Foreign);124 }125 126 return;127 }128 129 115 if (mainResourceCache) { 130 116 if (manifestURL == mainResourceCache->group()->m_manifestURL) { … … 201 187 202 188 ApplicationCache* mainResourceCache = documentLoader->mainResourceApplicationCache(); 203 bool isMainFrame = frame->page()->mainFrame() == frame; 204 205 if (isMainFrame && mainResourceCache) { 189 190 if (mainResourceCache) { 206 191 mainResourceCache->group()->associateDocumentLoaderWithCache(documentLoader, mainResourceCache); 207 192 mainResourceCache->group()->update(frame); -
trunk/WebCore/loader/appcache/DOMApplicationCache.cpp
r38845 r39474 56 56 return 0; 57 57 58 return m_frame->loader()->documentLoader()-> topLevelApplicationCache();58 return m_frame->loader()->documentLoader()->applicationCache(); 59 59 } 60 60
Note: See TracChangeset
for help on using the changeset viewer.