Changeset 100311 in webkit
- Timestamp:
- Nov 15, 2011 12:40:12 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r100310 r100311 1 2011-11-15 Nate Chapin <japhet@chromium.org> 2 3 Test udpates for https://bugs.webkit.org/show_bug.cgi?id=71149. 4 The changes to SubresourceLoader slightly change the timings of 5 certain resource load callbacks. 6 https://bugs.webkit.org/show_bug.cgi?id=71149 7 8 Reviewed by Adam Barth. 9 10 * fast/loader/file-protocol-fragment-expected.txt: 11 * platform/chromium-cg-mac/security/block-test-expected.txt: 12 * platform/chromium-mac/security/block-test-expected.txt: 13 * platform/chromium-win/security/block-test-expected.txt: 14 * platform/mac/fast/images/support-broken-image-delegate-expected.txt: 15 * platform/mac/security/block-test-expected.txt: 16 * platform/mac/webarchive/loading/cache-expired-subresource-expected.txt: 17 1 18 2011-11-15 Gavin Barraclough <barraclough@apple.com> 2 19 -
trunk/LayoutTests/fast/loader/file-protocol-fragment-expected.txt
r84930 r100311 5 5 resources/stylesheet.css - didFinishLoading 6 6 resources/stylesheet.css - didReceiveResponse <NSURLResponse resources/stylesheet.css, http status code 0> 7 resources/stylesheet.css - didFinishLoading 7 8 This tests that file: URL are loaded separately even if they differ by the fragment only. -
trunk/LayoutTests/platform/chromium-cg-mac/security/block-test-expected.txt
r56251 r100311 1 1 http://255.255.255.255:1/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:1/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) 2 2 <unknown> - didFinishLoading 3 http://255.255.255.255:1/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:1/test.jpg"> 3 4 http://255.255.255.255:7/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:7/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) 4 http://255.255.255.255:1/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:1/test.jpg">5 5 http://255.255.255.255:7/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:7/test.jpg"> 6 6 http://255.255.255.255:9/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:9/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) -
trunk/LayoutTests/platform/chromium-mac/security/block-test-expected.txt
r94434 r100311 1 1 http://255.255.255.255:1/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:1/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) 2 2 <unknown> - didFinishLoading 3 http://255.255.255.255:1/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:1/test.jpg"> 3 4 http://255.255.255.255:7/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:7/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) 4 http://255.255.255.255:1/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:1/test.jpg">5 5 http://255.255.255.255:7/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:7/test.jpg"> 6 6 http://255.255.255.255:9/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:9/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) -
trunk/LayoutTests/platform/chromium-win/security/block-test-expected.txt
r56271 r100311 1 1 http://255.255.255.255:1/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:1/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) 2 2 <unknown> - didFinishLoading 3 http://255.255.255.255:1/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:1/test.jpg"> 3 4 http://255.255.255.255:7/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:7/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) 4 http://255.255.255.255:1/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:1/test.jpg">5 5 http://255.255.255.255:7/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:7/test.jpg"> 6 6 http://255.255.255.255:9/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:9/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) -
trunk/LayoutTests/platform/mac/fast/images/support-broken-image-delegate-expected.txt
r79771 r100311 3 3 resources/broken-image-with-invalid-format.png - didReceiveResponse <NSURLResponse resources/broken-image-with-invalid-format.png, http status code 0> 4 4 resources/broken-image-with-invalid-format.png - shouldPaintBrokenImage: NO 5 resources/broken-image-with-invalid-format.png - didFinishLoading 5 6 Radar 8610908 - Add a resource delegate method to query if WebCore should paint the broken image. 6 7 -
trunk/LayoutTests/platform/mac/security/block-test-expected.txt
r78383 r100311 1 1 http://255.255.255.255:1/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:1/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) 2 2 <unknown> - didFinishLoading 3 http://255.255.255.255:1/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:1/test.jpg"> 3 4 http://255.255.255.255:7/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:7/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) 4 http://255.255.255.255:1/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:1/test.jpg">5 5 http://255.255.255.255:7/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:7/test.jpg"> 6 6 http://255.255.255.255:9/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:9/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null) -
trunk/LayoutTests/platform/mac/webarchive/loading/cache-expired-subresource-expected.txt
r63403 r100311 11 11 resources/cache-expired-subresource.webarchive - didFinishLoading 12 12 http://localhost/pink-bullet.png - didReceiveResponse <NSURLResponse http://localhost/test.php, http status code 200> 13 http://localhost/pink-bullet.png - didFinishLoading 13 14 frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame 14 15 main frame - didHandleOnloadEventsForFrame -
trunk/LayoutTests/webarchive/loading/test-loading-archive-subresource-null-mimetype-expected.txt
r99031 r100311 11 11 resources/subresource-null-mimetype.webarchive - didFinishLoading 12 12 file:///test.png - didReceiveResponse <NSURLResponse file:///Users/pecoraro/Desktop/test.png, http status code 0> 13 file:///test.png - didFinishLoading 13 14 frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame 14 15 main frame - didHandleOnloadEventsForFrame -
trunk/Source/WebCore/CMakeLists.txt
r100255 r100311 961 961 loader/cache/CachedResourceHandle.cpp 962 962 loader/cache/CachedResourceLoader.cpp 963 loader/cache/CachedResourceRequest.cpp964 963 loader/cache/CachedScript.cpp 965 964 loader/cache/CachedXSLStyleSheet.cpp -
trunk/Source/WebCore/ChangeLog
r100309 r100311 1 2011-11-15 Nate Chapin <japhet@chromium.org> 2 3 CachedResourceRequest is now the only SubresourceLoaderClient 4 Merge CachedResourceRequest into SubresourceLoader and delete 5 the SubresourceLoaderClient interface. A few items were moved 6 to CachedResource instead of SubresourceLoader. 7 https://bugs.webkit.org/show_bug.cgi?id=71149 8 9 Reviewed by Adam Barth. 10 11 * CMakeLists.txt: 12 * GNUmakefile.list.am: 13 * WebCore.gypi: 14 * WebCore.pro: 15 * WebCore.vcproj/WebCore.vcproj: 16 * WebCore.xcodeproj/project.pbxproj: 17 * loader/ResourceLoadScheduler.cpp: 18 * loader/ResourceLoadScheduler.h: 19 * loader/ResourceLoader.cpp: 20 * loader/SubresourceLoader.cpp: 21 (WebCore::SubresourceLoader::SubresourceLoader): 22 (WebCore::SubresourceLoader::create): 23 (WebCore::SubresourceLoader::init): Do work that had previously been 24 done in SubresourceLoader::create() after the constructor. 25 (WebCore::SubresourceLoader::willSendRequest): 26 (WebCore::SubresourceLoader::didSendData): 27 (WebCore::SubresourceLoader::didReceiveResponse): 28 (WebCore::SubresourceLoader::didReceiveData): 29 (WebCore::SubresourceLoader::didReceiveCachedMetadata): 30 (WebCore::SubresourceLoader::didFinishLoading): 31 (WebCore::SubresourceLoader::didFail): 32 (WebCore::SubresourceLoader::willCancel): 33 (WebCore::SubresourceLoader::releaseResources): Do the cleanup work that was 34 duplicated throughout the various terminal CachedResourceRequest callbacks. 35 * loader/SubresourceLoader.h: Fix indentation style issues. 36 * loader/SubresourceLoaderClient.h: Removed. 37 * loader/cache/CachedImage.cpp: 38 * loader/cache/CachedRawResource.cpp: 39 * loader/cache/CachedResource.cpp: 40 (WebCore::cachedResourceTypeToTargetType): 41 (WebCore::CachedResource::load): Do the work that had been done in 42 CachedResourceRequest::load(). 43 (WebCore::CachedResource::finish): 44 (WebCore::CachedResource::setResponse): 45 (WebCore::CachedResource::stopLoading): 46 * loader/cache/CachedResource.h: 47 (WebCore::CachedResource::canDelete): 48 * loader/cache/CachedResourceLoader.cpp: 49 * loader/cache/CachedResourceRequest.cpp: Removed. 50 * loader/cache/CachedResourceRequest.h: Removed. 51 * loader/cf/SubresourceLoaderCF.cpp: 52 * loader/chromium/CachedResourceRequestChromium.cpp: Removed. 53 * loader/chromium/SubresourceLoaderChromium.cpp: 54 1 55 2011-11-15 Anders Carlsson <andersca@apple.com> 2 56 -
trunk/Source/WebCore/GNUmakefile.list.am
r100191 r100311 2166 2166 Source/WebCore/loader/cache/CachedResourceLoader.cpp \ 2167 2167 Source/WebCore/loader/cache/CachedResourceLoader.h \ 2168 Source/WebCore/loader/cache/CachedResourceRequest.cpp \2169 Source/WebCore/loader/cache/CachedResourceRequest.h \2170 2168 Source/WebCore/loader/cache/CachedScript.cpp \ 2171 2169 Source/WebCore/loader/cache/CachedScript.h \ … … 2256 2254 Source/WebCore/loader/SubframeLoader.cpp \ 2257 2255 Source/WebCore/loader/SubframeLoader.h \ 2258 Source/WebCore/loader/SubresourceLoaderClient.h \2259 2256 Source/WebCore/loader/SubresourceLoader.cpp \ 2260 2257 Source/WebCore/loader/SubresourceLoader.h \ -
trunk/Source/WebCore/Target.pri
r100266 r100311 909 909 loader/cache/CachedRawResource.cpp \ 910 910 loader/cache/CachedResourceHandle.cpp \ 911 loader/cache/CachedResourceRequest.cpp \912 911 loader/cache/CachedResource.cpp \ 913 912 loader/cache/CachedScript.cpp \ … … 1951 1950 loader/cache/CachedResource.h \ 1952 1951 loader/cache/CachedResourceHandle.h \ 1953 loader/cache/CachedResourceRequest.h \1954 1952 loader/cache/CachedScript.h \ 1955 1953 loader/cache/CachedXSLStyleSheet.h \ -
trunk/Source/WebCore/WebCore.gypi
r100191 r100311 578 578 'loader/SubframeLoader.h', 579 579 'loader/SubresourceLoader.h', 580 'loader/SubresourceLoaderClient.h',581 580 'loader/SubstituteData.h', 582 581 'loader/SubstituteResource.h', … … 597 596 'loader/cache/CachedResourceHandle.h', 598 597 'loader/cache/CachedResourceLoader.h', 599 'loader/cache/CachedResourceRequest.h',600 598 'loader/cache/CachedStyleSheetClient.h', 601 599 'loader/cache/MemoryCache.h', … … 2862 2860 'loader/cache/CachedResourceHandle.cpp', 2863 2861 'loader/cache/CachedResourceLoader.cpp', 2864 'loader/cache/CachedResourceRequest.cpp',2865 2862 'loader/cache/CachedScript.cpp', 2866 2863 'loader/cache/CachedScript.h', … … 2872 2869 'loader/cf/ResourceLoaderCFNet.cpp', 2873 2870 'loader/chromium/CachedRawResourceChromium.cpp', 2874 'loader/chromium/CachedResourceRequestChromium.cpp',2875 2871 'loader/chromium/DocumentThreadableLoaderChromium.cpp', 2876 2872 'loader/chromium/ResourceLoaderChromium.cpp', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r100198 r100311 25895 25895 </File> 25896 25896 <File 25897 RelativePath="..\loader\SubresourceLoaderClient.h"25898 >25899 </File>25900 <File25901 25897 RelativePath="..\loader\SubstituteData.h" 25902 25898 > … … 26187 26183 <File 26188 26184 RelativePath="..\loader\cache\CachedResourceLoader.h" 26189 >26190 </File>26191 <File26192 RelativePath="..\loader\cache\CachedResourceRequest.cpp"26193 >26194 </File>26195 <File26196 RelativePath="..\loader\cache\CachedResourceRequest.h"26197 26185 > 26198 26186 </File> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r100178 r100311 361 361 1A2E6E5A0CC55213004A2062 /* SQLValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2E6E580CC55213004A2062 /* SQLValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; 362 362 1A2E6E7A0CC556D5004A2062 /* SQLiteAuthorizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */; }; 363 1A3178930B20A81600316987 /* SubresourceLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3178920B20A81600316987 /* SubresourceLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; };364 363 1A3417C90CECFF250049CBDE /* JSCustomVoidCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3417C70CECFF250049CBDE /* JSCustomVoidCallback.h */; }; 365 364 1A3417CA0CECFF250049CBDE /* JSCustomVoidCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3417C80CECFF250049CBDE /* JSCustomVoidCallback.cpp */; }; … … 5764 5763 D0CE58F8125E4CC200F3F199 /* ResourceLoadScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0CE58F6125E4CC200F3F199 /* ResourceLoadScheduler.cpp */; }; 5765 5764 D0CE58F9125E4CC200F3F199 /* ResourceLoadScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CE58F7125E4CC200F3F199 /* ResourceLoadScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5766 D0D141B212B2BF5200E39620 /* CachedResourceRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0D141B012B2BF5200E39620 /* CachedResourceRequest.cpp */; };5767 D0D141B312B2BF5200E39620 /* CachedResourceRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D141B112B2BF5200E39620 /* CachedResourceRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };5768 5765 D0EDA774143E303C0028E383 /* CachedRawResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0EDA772143E303C0028E383 /* CachedRawResource.cpp */; }; 5769 5766 D0EDA775143E303C0028E383 /* CachedRawResource.h in Headers */ = {isa = PBXBuildFile; fileRef = D0EDA773143E303C0028E383 /* CachedRawResource.h */; }; … … 7425 7422 1A2E6E580CC55213004A2062 /* SQLValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SQLValue.h; path = sql/SQLValue.h; sourceTree = "<group>"; }; 7426 7423 1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SQLiteAuthorizer.cpp; path = sql/SQLiteAuthorizer.cpp; sourceTree = "<group>"; }; 7427 1A3178920B20A81600316987 /* SubresourceLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubresourceLoaderClient.h; sourceTree = "<group>"; };7428 7424 1A3417C70CECFF250049CBDE /* JSCustomVoidCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomVoidCallback.h; sourceTree = "<group>"; }; 7429 7425 1A3417C80CECFF250049CBDE /* JSCustomVoidCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomVoidCallback.cpp; sourceTree = "<group>"; }; … … 13096 13092 D0CE58F6125E4CC200F3F199 /* ResourceLoadScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadScheduler.cpp; sourceTree = "<group>"; }; 13097 13093 D0CE58F7125E4CC200F3F199 /* ResourceLoadScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadScheduler.h; sourceTree = "<group>"; }; 13098 D0D141B012B2BF5200E39620 /* CachedResourceRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceRequest.cpp; sourceTree = "<group>"; };13099 D0D141B112B2BF5200E39620 /* CachedResourceRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedResourceRequest.h; sourceTree = "<group>"; };13100 13094 D0EDA772143E303C0028E383 /* CachedRawResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedRawResource.cpp; sourceTree = "<group>"; }; 13101 13095 D0EDA773143E303C0028E383 /* CachedRawResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedRawResource.h; sourceTree = "<group>"; }; … … 18498 18492 BCB16C100979C3BD00467741 /* CachedResourceLoader.cpp */, 18499 18493 BCB16C110979C3BD00467741 /* CachedResourceLoader.h */, 18500 D0D141B012B2BF5200E39620 /* CachedResourceRequest.cpp */,18501 D0D141B112B2BF5200E39620 /* CachedResourceRequest.h */,18502 18494 BCB16C0A0979C3BD00467741 /* CachedScript.cpp */, 18503 18495 BCB16C0B0979C3BD00467741 /* CachedScript.h */, … … 19950 19942 93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */, 19951 19943 656D37300ADBA5DE00A4554D /* SubresourceLoader.h */, 19952 1A3178920B20A81600316987 /* SubresourceLoaderClient.h */,19953 19944 659A7D120B6DB4D9001155B3 /* SubstituteData.h */, 19954 19945 1A8F6B010DB53006001DB794 /* SubstituteResource.h */, … … 21804 21795 E47B4BE80E71241600038854 /* CachedResourceHandle.h in Headers */, 21805 21796 BCB16C2A0979C3BD00467741 /* CachedResourceLoader.h in Headers */, 21806 D0D141B312B2BF5200E39620 /* CachedResourceRequest.h in Headers */,21807 21797 BCB16C240979C3BD00467741 /* CachedScript.h in Headers */, 21808 21798 BCD533640ED6848900887468 /* CachedScriptSourceProvider.h in Headers */, … … 24144 24134 F55B3DD41251F12D003EF269 /* SubmitInputType.h in Headers */, 24145 24135 656D37480ADBA5DE00A4554D /* SubresourceLoader.h in Headers */, 24146 1A3178930B20A81600316987 /* SubresourceLoaderClient.h in Headers */,24147 24136 659A7D130B6DB4D9001155B3 /* SubstituteData.h in Headers */, 24148 24137 1A8F6B020DB53006001DB794 /* SubstituteResource.h in Headers */, … … 25155 25144 E47B4BE90E71241600038854 /* CachedResourceHandle.cpp in Sources */, 25156 25145 BCB16C290979C3BD00467741 /* CachedResourceLoader.cpp in Sources */, 25157 D0D141B212B2BF5200E39620 /* CachedResourceRequest.cpp in Sources */,25158 25146 BCB16C230979C3BD00467741 /* CachedScript.cpp in Sources */, 25159 25147 BCB16C270979C3BD00467741 /* CachedXSLStyleSheet.cpp in Sources */, -
trunk/Source/WebCore/loader/ResourceLoadScheduler.cpp
r96060 r100311 86 86 } 87 87 88 PassRefPtr<SubresourceLoader> ResourceLoadScheduler::scheduleSubresourceLoad(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, ResourceLoadPriority priority, const ResourceLoaderOptions& options)89 { 90 RefPtr<SubresourceLoader> loader = SubresourceLoader::create(frame, client, request, options);88 PassRefPtr<SubresourceLoader> ResourceLoadScheduler::scheduleSubresourceLoad(Frame* frame, CachedResource* resource, const ResourceRequest& request, ResourceLoadPriority priority, const ResourceLoaderOptions& options) 89 { 90 RefPtr<SubresourceLoader> loader = SubresourceLoader::create(frame, resource, request, options); 91 91 if (loader) 92 92 scheduleLoad(loader.get(), priority); -
trunk/Source/WebCore/loader/ResourceLoadScheduler.h
r96060 r100311 38 38 namespace WebCore { 39 39 40 class CachedResource; 40 41 class Frame; 41 42 class KURL; … … 45 46 class ResourceRequest; 46 47 class SubresourceLoader; 47 class SubresourceLoaderClient;48 48 49 49 class ResourceLoadScheduler { … … 52 52 friend ResourceLoadScheduler* resourceLoadScheduler(); 53 53 54 PassRefPtr<SubresourceLoader> scheduleSubresourceLoad(Frame*, SubresourceLoaderClient*, const ResourceRequest&, ResourceLoadPriority, const ResourceLoaderOptions&);54 PassRefPtr<SubresourceLoader> scheduleSubresourceLoad(Frame*, CachedResource*, const ResourceRequest&, ResourceLoadPriority, const ResourceLoaderOptions&); 55 55 PassRefPtr<NetscapePlugInStreamLoader> schedulePluginStreamLoad(Frame*, NetscapePlugInStreamLoaderClient*, const ResourceRequest&); 56 56 void addMainResourceLoad(ResourceLoader*); -
trunk/Source/WebCore/loader/ResourceLoader.cpp
r96249 r100311 132 132 willSendRequest(clientRequest, ResourceResponse()); 133 133 if (clientRequest.isNull()) { 134 didFail(cancelledError());134 cancel(); 135 135 return false; 136 136 } -
trunk/Source/WebCore/loader/SubresourceLoader.cpp
r99659 r100311 30 30 #include "SubresourceLoader.h" 31 31 32 #include "CachedImage.h" 33 #include "CachedResourceLoader.h" 32 34 #include "Document.h" 33 35 #include "DocumentLoader.h" 34 36 #include "Frame.h" 35 37 #include "FrameLoader.h" 36 #include "ResourceHandle.h" 38 #include "Logging.h" 39 #include "MemoryCache.h" 37 40 #include "SecurityOrigin.h" 38 41 #include "SecurityPolicy.h" 39 #include "SubresourceLoaderClient.h"40 42 #include <wtf/RefCountedLeakCounter.h> 41 43 #include <wtf/StdLibExtras.h> … … 45 47 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, subresourceLoaderCounter, ("SubresourceLoader")); 46 48 47 SubresourceLoader::SubresourceLoader(Frame* frame, SubresourceLoaderClient* client, const ResourceLoaderOptions& options)49 SubresourceLoader::SubresourceLoader(Frame* frame, CachedResource* resource, const ResourceLoaderOptions& options) 48 50 : ResourceLoader(frame, options) 49 , m_client(client) 51 , m_resource(resource) 52 , m_document(frame->document()) 50 53 , m_loadingMultipartContent(false) 54 , m_state(Uninitialized) 51 55 { 52 56 #ifndef NDEBUG … … 62 66 } 63 67 64 PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, const ResourceLoaderOptions& options)68 PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, CachedResource* resource, const ResourceRequest& request, const ResourceLoaderOptions& options) 65 69 { 66 70 if (!frame) … … 95 99 frameLoader->addExtraFieldsToSubresourceRequest(newRequest); 96 100 97 RefPtr<SubresourceLoader> subloader(adoptRef(new SubresourceLoader(frame, client, options)));101 RefPtr<SubresourceLoader> subloader(adoptRef(new SubresourceLoader(frame, resource, options))); 98 102 if (!subloader->init(newRequest)) 99 103 return 0; 100 subloader->documentLoader()->addSubresourceLoader(subloader.get());101 102 104 return subloader.release(); 105 } 106 107 bool SubresourceLoader::init(const ResourceRequest& request) 108 { 109 if (!ResourceLoader::init(request)) 110 return false; 111 112 m_state = Initialized; 113 m_documentLoader->addSubresourceLoader(this); 114 return true; 103 115 } 104 116 … … 109 121 110 122 ResourceLoader::willSendRequest(newRequest, redirectResponse); 111 if (!previousURL.isNull() && !newRequest.isNull() && previousURL != newRequest.url() && m_client) 112 m_client->willSendRequest(this, newRequest, redirectResponse); 123 if (!previousURL.isNull() && !newRequest.isNull() && previousURL != newRequest.url()) { 124 if (!m_document->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url())) { 125 cancel(); 126 return; 127 } 128 m_resource->willSendRequest(newRequest, redirectResponse); 129 } 113 130 } 114 131 … … 116 133 { 117 134 RefPtr<SubresourceLoader> protect(this); 118 119 if (m_client) 120 m_client->didSendData(this, bytesSent, totalBytesToBeSent); 121 } 122 123 void SubresourceLoader::didReceiveResponse(const ResourceResponse& r) 124 { 125 ASSERT(!r.isNull()); 126 127 if (r.isMultipart()) 128 m_loadingMultipartContent = true; 135 m_resource->didSendData(bytesSent, totalBytesToBeSent); 136 } 137 138 void SubresourceLoader::didReceiveResponse(const ResourceResponse& response) 139 { 140 ASSERT(!response.isNull()); 129 141 130 142 // Reference the object in this method since the additional processing can do … … 132 144 RefPtr<SubresourceLoader> protect(this); 133 145 134 if (m_client) 135 m_client->didReceiveResponse(this, r); 136 137 // The loader can cancel a load if it receives a multipart response for a non-image 146 if (m_resource->resourceToRevalidate()) { 147 if (response.httpStatusCode() == 304) { 148 // 304 Not modified / Use local copy 149 // Existing resource is ok, just use it updating the expiration time. 150 memoryCache()->revalidationSucceeded(m_resource, response); 151 ResourceLoader::didReceiveResponse(response); 152 return; 153 } 154 // Did not get 304 response, continue as a regular resource load. 155 memoryCache()->revalidationFailed(m_resource); 156 } 157 158 m_resource->setResponse(response); 138 159 if (reachedTerminalState()) 139 160 return; 140 ResourceLoader::didReceiveResponse(r); 141 161 ResourceLoader::didReceiveResponse(response); 162 163 if (m_loadingMultipartContent) { 164 ASSERT(m_resource->isImage()); 165 static_cast<CachedImage*>(m_resource)->clear(); 166 } else if (response.isMultipart()) { 167 m_loadingMultipartContent = true; 168 169 // We don't count multiParts in a CachedResourceLoader's request count 170 m_document->cachedResourceLoader()->decrementRequestCount(m_resource); 171 if (!m_resource->isImage()) { 172 cancel(); 173 return; 174 } 175 } 176 142 177 RefPtr<SharedBuffer> buffer = resourceData(); 143 178 if (m_loadingMultipartContent && buffer && buffer->size()) { … … 145 180 // deliver the previously received data to the loader all at once now. 146 181 // Then clear the data to make way for the next multipart section. 147 if (m_client) 148 m_client->didReceiveData(this, buffer->data(), buffer->size()); 182 didReceiveData(buffer->data(), buffer->size(), -1, true); 149 183 clearResourceData(); 150 184 … … 157 191 void SubresourceLoader::didReceiveData(const char* data, int length, long long encodedDataLength, bool allAtOnce) 158 192 { 193 ASSERT(!m_resource->resourceToRevalidate()); 194 ASSERT(!m_resource->errorOccurred()); 159 195 // Reference the object in this method since the additional processing can do 160 196 // anything including removing the last reference to this object; one example of this is 3266216. 161 197 RefPtr<SubresourceLoader> protect(this); 162 163 198 ResourceLoader::didReceiveData(data, length, encodedDataLength, allAtOnce); 164 199 165 // A subresource loader does not load multipart sections progressively. 166 // So don't deliver any data to the loader yet. 167 if (!m_loadingMultipartContent && m_client) 168 m_client->didReceiveData(this, data, length); 200 if (m_resource->response().httpStatusCode() >= 400 && !m_resource->shouldIgnoreHTTPStatusCodeErrors()) { 201 m_resource->error(CachedResource::LoadError); 202 m_state = Finishing; 203 cancel(); 204 return; 205 } 206 207 // There are two cases where we might need to create our own SharedBuffer instead of copying the one in ResourceLoader. 208 // (1) Multipart content: The loader delivers the data in a multipart section all at once, then sends eof. 209 // The resource data will change as the next part is loaded, so we need to make a copy. 210 // (2) Our client requested that the data not be buffered at the ResourceLoader level via ResourceLoaderOptions. In this case, 211 // ResourceLoader::resourceData() will be null. However, unlike the multipart case, we don't want to tell the CachedResource 212 // that all data has been received yet. 213 if (m_loadingMultipartContent || !resourceData()) { 214 RefPtr<SharedBuffer> copiedData = SharedBuffer::create(data, length); 215 m_resource->data(copiedData.release(), m_loadingMultipartContent); 216 } else 217 m_resource->data(resourceData(), false); 169 218 } 170 219 171 220 void SubresourceLoader::didReceiveCachedMetadata(const char* data, int length) 172 221 { 173 // Reference the object in this method since the additional processing can do 174 // anything including removing the last reference to this object; one example of this is 3266216. 175 RefPtr<SubresourceLoader> protect(this); 176 177 if (m_client) 178 m_client->didReceiveCachedMetadata(this, data, length); 222 ASSERT(!m_resource->resourceToRevalidate()); 223 m_resource->setSerializedCachedMetadata(data, length); 179 224 } 180 225 181 226 void SubresourceLoader::didFinishLoading(double finishTime) 182 227 { 183 if (cancelled()) 184 return; 185 ASSERT(!reachedTerminalState()); 186 187 // Calling removeSubresourceLoader will likely result in a call to deref, so we must protect ourselves. 188 RefPtr<SubresourceLoader> protect(this); 189 190 if (m_client) 191 m_client->didFinishLoading(this, finishTime); 192 193 m_handle = 0; 194 195 if (cancelled()) 196 return; 197 m_documentLoader->removeSubresourceLoader(this); 228 if (m_state != Initialized) 229 return; 230 ASSERT(!reachedTerminalState()); 231 ASSERT(!m_resource->resourceToRevalidate()); 232 ASSERT(!m_resource->errorOccurred()); 233 LOG(ResourceLoading, "Received '%s'.", m_resource->url().string().latin1().data()); 234 235 RefPtr<SubresourceLoader> protect(this); 236 m_state = Finishing; 237 m_resource->setLoadFinishTime(finishTime); 238 m_resource->data(resourceData(), true); 239 m_resource->finish(); 198 240 ResourceLoader::didFinishLoading(finishTime); 199 241 } … … 201 243 void SubresourceLoader::didFail(const ResourceError& error) 202 244 { 203 if (cancelled()) 204 return; 205 ASSERT(!reachedTerminalState()); 206 207 // Calling removeSubresourceLoader will likely result in a call to deref, so we must protect ourselves. 208 RefPtr<SubresourceLoader> protect(this); 209 210 if (m_client) 211 m_client->didFail(this, error); 212 213 m_handle = 0; 214 215 if (cancelled()) 216 return; 217 m_documentLoader->removeSubresourceLoader(this); 245 if (m_state != Initialized) 246 return; 247 ASSERT(!reachedTerminalState()); 248 ASSERT(!m_resource->resourceToRevalidate()); 249 LOG(ResourceLoading, "Failed to load '%s'.\n", m_resource->url().string().latin1().data()); 250 251 RefPtr<SubresourceLoader> protect(this); 252 m_state = Finishing; 253 m_resource->error(CachedResource::LoadError); 254 if (!m_resource->isPreloaded()) 255 memoryCache()->remove(m_resource); 218 256 ResourceLoader::didFail(error); 219 257 } 220 258 221 void SubresourceLoader::willCancel(const ResourceError& error) 222 { 223 if (m_client) 224 m_client->didFail(this, error); 225 } 226 227 void SubresourceLoader::didCancel(const ResourceError&) 228 { 229 m_documentLoader->removeSubresourceLoader(this); 230 } 231 232 } 259 void SubresourceLoader::willCancel(const ResourceError&) 260 { 261 if (m_state != Initialized) 262 return; 263 ASSERT(!reachedTerminalState()); 264 LOG(ResourceLoading, "Cancelled load of '%s'.\n", m_resource->url().string().latin1().data()); 265 266 RefPtr<SubresourceLoader> protect(this); 267 m_state = Finishing; 268 if (m_resource->resourceToRevalidate()) 269 memoryCache()->revalidationFailed(m_resource); 270 memoryCache()->remove(m_resource); 271 } 272 273 void SubresourceLoader::releaseResources() 274 { 275 ASSERT(!reachedTerminalState()); 276 if (m_state != Uninitialized) { 277 if (!m_loadingMultipartContent && m_state != Releasing) 278 m_document->cachedResourceLoader()->decrementRequestCount(m_resource); 279 m_state = Releasing; 280 m_document->cachedResourceLoader()->loadDone(); 281 if (reachedTerminalState()) 282 return; 283 m_resource->stopLoading(); 284 m_documentLoader->removeSubresourceLoader(this); 285 } 286 m_document = 0; 287 ResourceLoader::releaseResources(); 288 } 289 290 } -
trunk/Source/WebCore/loader/SubresourceLoader.h
r96060 r100311 37 37 namespace WebCore { 38 38 39 class ResourceRequest; 40 class SubresourceLoaderClient; 41 42 class SubresourceLoader : public ResourceLoader { 43 public: 44 static PassRefPtr<SubresourceLoader> create(Frame*, SubresourceLoaderClient*, const ResourceRequest&, const ResourceLoaderOptions&); 39 class CachedResource; 40 class Document; 41 class ResourceRequest; 45 42 46 void clearClient() { m_client = 0; } 43 class SubresourceLoader : public ResourceLoader { 44 public: 45 static PassRefPtr<SubresourceLoader> create(Frame*, CachedResource*, const ResourceRequest&, const ResourceLoaderOptions&); 47 46 48 private: 49 SubresourceLoader(Frame*, SubresourceLoaderClient*, const ResourceLoaderOptions&); 50 virtual ~SubresourceLoader(); 51 52 virtual void willSendRequest(ResourceRequest&, const ResourceResponse& redirectResponse); 53 virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent); 54 virtual void didReceiveResponse(const ResourceResponse&); 55 virtual void didReceiveData(const char*, int, long long encodedDataLength, bool allAtOnce); 56 virtual void didReceiveCachedMetadata(const char*, int); 57 virtual void didFinishLoading(double finishTime); 58 virtual void didFail(const ResourceError&); 59 virtual void willCancel(const ResourceError&); 60 virtual void didCancel(const ResourceError&); 47 private: 48 SubresourceLoader(Frame*, CachedResource*, const ResourceLoaderOptions&); 49 virtual ~SubresourceLoader(); 50 virtual bool init(const ResourceRequest&); 51 52 virtual void willSendRequest(ResourceRequest&, const ResourceResponse& redirectResponse); 53 virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent); 54 virtual void didReceiveResponse(const ResourceResponse&); 55 virtual void didReceiveData(const char*, int, long long encodedDataLength, bool allAtOnce); 56 virtual void didReceiveCachedMetadata(const char*, int); 57 virtual void didFinishLoading(double finishTime); 58 virtual void didFail(const ResourceError&); 59 virtual void willCancel(const ResourceError&); 60 virtual void didCancel(const ResourceError&) { } 61 61 62 62 #if HAVE(NETWORK_CFDATA_ARRAY_CALLBACK) 63 64 63 virtual bool supportsDataArray() { return true; } 64 virtual void didReceiveDataArray(CFArrayRef); 65 65 #endif 66 66 #if PLATFORM(CHROMIUM) 67 67 virtual void didDownloadData(int); 68 68 #endif 69 virtual void releaseResources(); 69 70 70 SubresourceLoaderClient* m_client; 71 bool m_loadingMultipartContent; 71 enum SubresourceLoaderState { 72 Uninitialized, 73 Initialized, 74 Finishing, 75 Releasing 72 76 }; 77 78 CachedResource* m_resource; 79 RefPtr<Document> m_document; 80 bool m_loadingMultipartContent; 81 SubresourceLoaderState m_state; 82 }; 73 83 74 84 } -
trunk/Source/WebCore/loader/cache/CachedImage.cpp
r99539 r100311 30 30 #include "CachedResourceClientWalker.h" 31 31 #include "CachedResourceLoader.h" 32 #include "CachedResourceRequest.h"33 32 #include "Frame.h" 34 33 #include "FrameLoaderClient.h" … … 38 37 #include "Settings.h" 39 38 #include "SharedBuffer.h" 39 #include "SubresourceLoader.h" 40 40 #include <wtf/CurrentTime.h> 41 41 #include <wtf/StdLibExtras.h> … … 288 288 void CachedImage::checkShouldPaintBrokenImage() 289 289 { 290 Frame* frame = m_request ? m_request->cachedResourceLoader()->frame() : 0; 291 if (!frame) 292 return; 293 294 m_shouldPaintBrokenImage = frame->loader()->client()->shouldPaintBrokenImage(m_resourceRequest.url()); 290 if (!m_loader || m_loader->reachedTerminalState()) 291 return; 292 293 m_shouldPaintBrokenImage = m_loader->frameLoader()->client()->shouldPaintBrokenImage(m_resourceRequest.url()); 295 294 } 296 295 … … 329 328 size_t CachedImage::maximumDecodedImageSize() 330 329 { 331 Frame* frame = m_request ? m_request->cachedResourceLoader()->frame() : 0; 332 if (!frame) 330 if (!m_loader || m_loader->reachedTerminalState()) 333 331 return 0; 334 Settings* settings = frame->settings();332 Settings* settings = m_loader->frameLoader()->frame()->settings(); 335 333 return settings ? settings->maximumDecodedImageSize() : 0; 336 334 } -
trunk/Source/WebCore/loader/cache/CachedRawResource.cpp
r98380 r100311 30 30 #include "CachedResourceClientWalker.h" 31 31 #include "CachedResourceLoader.h" 32 #include "CachedResourceRequest.h"33 32 #include "SharedBuffer.h" 33 #include "SubresourceLoader.h" 34 34 #include <wtf/PassRefPtr.h> 35 35 … … 79 79 void CachedRawResource::allClientsRemoved() 80 80 { 81 if (m_ request)82 m_ request->cancel();81 if (m_loader) 82 m_loader->cancel(); 83 83 } 84 84 … … 110 110 void CachedRawResource::setDefersLoading(bool defers) 111 111 { 112 if (m_ request)113 m_ request->setDefersLoading(defers);112 if (m_loader) 113 m_loader->setDefersLoading(defers); 114 114 } 115 115 116 116 unsigned long CachedRawResource::identifier() const 117 117 { 118 return m_ request ? m_request->identifier() : 0;118 return m_loader ? m_loader->identifier() : 0; 119 119 } 120 120 -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r99565 r100311 31 31 #include "CachedResourceHandle.h" 32 32 #include "CachedResourceLoader.h" 33 #include "CachedResourceRequest.h"34 33 #include "CrossOriginAccessControl.h" 34 #include "Document.h" 35 35 #include "Frame.h" 36 36 #include "FrameLoaderClient.h" … … 39 39 #include "PurgeableBuffer.h" 40 40 #include "ResourceHandle.h" 41 #include "ResourceLoadScheduler.h" 41 42 #include "SharedBuffer.h" 43 #include "SubresourceLoader.h" 42 44 #include <wtf/CurrentTime.h> 43 45 #include <wtf/MathExtras.h> … … 80 82 return ResourceLoadPriorityLow; 81 83 } 84 85 #if PLATFORM(CHROMIUM) 86 static ResourceRequest::TargetType cachedResourceTypeToTargetType(CachedResource::Type type) 87 { 88 switch (type) { 89 case CachedResource::CSSStyleSheet: 90 #if ENABLE(XSLT) 91 case CachedResource::XSLStyleSheet: 92 #endif 93 return ResourceRequest::TargetIsStyleSheet; 94 case CachedResource::Script: 95 return ResourceRequest::TargetIsScript; 96 case CachedResource::FontResource: 97 return ResourceRequest::TargetIsFontResource; 98 case CachedResource::ImageResource: 99 return ResourceRequest::TargetIsImage; 100 case CachedResource::RawResource: 101 return ResourceRequest::TargetIsSubresource; 102 #if ENABLE(LINK_PREFETCH) 103 case CachedResource::LinkPrefetch: 104 return ResourceRequest::TargetIsPrefetch; 105 case CachedResource::LinkPrerender: 106 return ResourceRequest::TargetIsPrerender; 107 case CachedResource::LinkSubresource: 108 return ResourceRequest::TargetIsSubresource; 109 #endif 110 #if ENABLE(VIDEO_TRACK) 111 case CachedResource::TextTrackResource: 112 return ResourceRequest::TargetIsTextTrack; 113 #endif 114 } 115 ASSERT_NOT_REACHED(); 116 return ResourceRequest::TargetIsSubresource; 117 } 118 #endif 82 119 83 120 DEFINE_DEBUG_ONLY_GLOBAL(RefCountedLeakCounter, cachedResourceLeakCounter, ("CachedResource")); … … 140 177 m_options = options; 141 178 m_loading = true; 142 m_request = CachedResourceRequest::load(cachedResourceLoader, this, options); 143 if (m_request) { 144 m_status = Pending; 145 cachedResourceLoader->incrementRequestCount(this); 146 } 179 180 #if PLATFORM(CHROMIUM) 181 if (m_resourceRequest.targetType() == ResourceRequest::TargetIsUnspecified) 182 m_resourceRequest.setTargetType(cachedResourceTypeToTargetType(type())); 183 #endif 184 185 if (!accept().isEmpty()) 186 m_resourceRequest.setHTTPAccept(accept()); 187 188 if (isCacheValidator()) { 189 CachedResource* resourceToRevalidate = m_resourceToRevalidate; 190 ASSERT(resourceToRevalidate->canUseCacheValidator()); 191 ASSERT(resourceToRevalidate->isLoaded()); 192 const String& lastModified = resourceToRevalidate->response().httpHeaderField("Last-Modified"); 193 const String& eTag = resourceToRevalidate->response().httpHeaderField("ETag"); 194 if (!lastModified.isEmpty() || !eTag.isEmpty()) { 195 ASSERT(cachedResourceLoader->cachePolicy() != CachePolicyReload); 196 if (cachedResourceLoader->cachePolicy() == CachePolicyRevalidate) 197 m_resourceRequest.setHTTPHeaderField("Cache-Control", "max-age=0"); 198 if (!lastModified.isEmpty()) 199 m_resourceRequest.setHTTPHeaderField("If-Modified-Since", lastModified); 200 if (!eTag.isEmpty()) 201 m_resourceRequest.setHTTPHeaderField("If-None-Match", eTag); 202 } 203 } 204 205 #if ENABLE(LINK_PREFETCH) 206 if (type() == CachedResource::LinkPrefetch || type() == CachedResource::LinkPrerender || type() == CachedResource::LinkSubresource) 207 m_resourceRequest.setHTTPHeaderField("Purpose", "prefetch"); 208 #endif 209 m_resourceRequest.setPriority(loadPriority()); 210 211 m_loader = resourceLoadScheduler()->scheduleSubresourceLoad(cachedResourceLoader->document()->frame(), this, m_resourceRequest, m_resourceRequest.priority(), options); 212 if (!m_loader || m_loader->reachedTerminalState()) { 213 // FIXME: What if resources in other frames were waiting for this revalidation? 214 LOG(ResourceLoading, "Cannot start loading '%s'", url().string().latin1().data()); 215 if (m_resourceToRevalidate) 216 memoryCache()->revalidationFailed(this); 217 error(CachedResource::LoadError); 218 return; 219 } 220 221 m_status = Pending; 222 cachedResourceLoader->incrementRequestCount(this); 147 223 } 148 224 … … 178 254 void CachedResource::finish() 179 255 { 180 m_status = Cached; 256 if (!errorOccurred()) 257 m_status = Cached; 181 258 } 182 259 … … 233 310 m_response = response; 234 311 m_responseTimestamp = currentTime(); 312 String encoding = response.textEncodingName(); 313 if (!encoding.isNull()) 314 setEncoding(encoding); 235 315 } 236 316 … … 265 345 void CachedResource::stopLoading() 266 346 { 267 ASSERT(m_ request);268 m_ request.clear();347 ASSERT(m_loader); 348 m_loader = 0; 269 349 270 350 CachedResourceHandle<CachedResource> protect(this); -
trunk/Source/WebCore/loader/cache/CachedResource.h
r99565 r100311 45 45 class CachedResourceHandleBase; 46 46 class CachedResourceLoader; 47 class CachedResourceRequest;48 47 class Frame; 49 48 class InspectorResource; 50 49 class PurgeableBuffer; 51 50 class SecurityOrigin; 51 class SubresourceLoader; 52 52 53 53 // A resource that is held in the cache. Classes who want to use this object should derive … … 188 188 CachedMetadata* cachedMetadata(unsigned dataTypeID) const; 189 189 190 bool canDelete() const { return !hasClients() && !m_ request&& !m_preloadCount && !m_handleCount && !m_resourceToRevalidate && !m_proxyResource; }190 bool canDelete() const { return !hasClients() && !m_loader && !m_preloadCount && !m_handleCount && !m_resourceToRevalidate && !m_proxyResource; } 191 191 bool hasOneHandle() const { return m_handleCount == 1; } 192 192 … … 254 254 ResourceRequest m_resourceRequest; 255 255 String m_accept; 256 OwnPtr<CachedResourceRequest> m_request;256 RefPtr<SubresourceLoader> m_loader; 257 257 ResourceLoaderOptions m_options; 258 258 ResourceLoadPriority m_loadPriority; -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r99329 r100311 32 32 #include "CachedImage.h" 33 33 #include "CachedRawResource.h" 34 #include "CachedResourceRequest.h"35 34 #include "CachedScript.h" 36 35 #include "CachedXSLStyleSheet.h" -
trunk/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp
r95901 r100311 26 26 #include "SubresourceLoader.h" 27 27 28 #include "SubresourceLoaderClient.h"29 30 28 namespace WebCore { 31 29 … … 47 45 break; 48 46 CFDataRef data = reinterpret_cast<CFDataRef>(CFArrayGetValueAtIndex(dataArray, i)); 49 m_client->didReceiveData(this, reinterpret_cast<const char *>(CFDataGetBytePtr(data)), static_cast<int>(CFDataGetLength(data)));47 didReceiveData(reinterpret_cast<const char *>(CFDataGetBytePtr(data)), static_cast<int>(CFDataGetLength(data)), -1, false); 50 48 } 51 49 } -
trunk/Source/WebCore/loader/chromium/SubresourceLoaderChromium.cpp
r95901 r100311 32 32 #include "SubresourceLoader.h" 33 33 34 #include " SubresourceLoaderClient.h"34 #include "CachedResource.h" 35 35 #include <wtf/RefCountedLeakCounter.h> 36 36 … … 44 44 45 45 ResourceLoader::didDownloadData(length); 46 47 if (m_client) 48 m_client->didDownloadData(this, length); 46 m_resource->didDownloadData(length); 49 47 } 50 48
Note: See TracChangeset
for help on using the changeset viewer.