Changeset 86290 in webkit
- Timestamp:
- May 11, 2011 5:28:14 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86289 r86290 1 2011-05-11 Antoine Labour <piman@chromium.org> 2 3 Reviewed by David Levin. 4 5 Expose shouldBufferData to ThreadableLoaderOptions to be able to disable buffering of the 6 loaded resource. 7 https://bugs.webkit.org/show_bug.cgi?id=60656 8 9 * loader/DocumentThreadableLoader.cpp: 10 (WebCore::DocumentThreadableLoader::loadRequest): 11 Pass the shouldBufferData to the resource load scheduler, forcing it to true for the 12 preflight request. 13 * loader/ResourceLoadScheduler.cpp: 14 (WebCore::ResourceLoadScheduler::scheduleSubresourceLoad): 15 Pass through shouldBufferData to SubresourceLoader::create 16 * loader/ResourceLoadScheduler.h: 17 18 * loader/SubresourceLoader.cpp: 19 (WebCore::SubresourceLoader::create): 20 Set shouldBufferData on the newly created loader 21 22 * loader/SubresourceLoader.h: 23 24 * loader/ThreadableLoader.h: 25 (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): 26 Add shouldBufferData to the options, defaulting to true. 27 1 28 2011-05-11 Jay Civelli <jcivelli@chromium.org> 2 29 -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r84923 r86290 347 347 bool sendLoadCallbacks = m_options.sendLoadCallbacks && !m_actualRequest; 348 348 bool sniffContent = m_options.sniffContent && !m_actualRequest; 349 // Keep buffering the data for the preflight request. 350 bool shouldBufferData = m_options.shouldBufferData || m_actualRequest; 349 351 350 352 // Clear the loader so that any callbacks from SubresourceLoader::create will not have the old loader. 351 353 m_loader = 0; 352 354 m_loader = resourceLoadScheduler()->scheduleSubresourceLoad(m_document->frame(), this, request, ResourceLoadPriorityMedium, securityCheck, sendLoadCallbacks, 353 sniffContent, m_optionalOutgoingReferrer );355 sniffContent, m_optionalOutgoingReferrer, shouldBufferData); 354 356 return; 355 357 } -
trunk/Source/WebCore/loader/ResourceLoadScheduler.cpp
r82951 r86290 85 85 86 86 PassRefPtr<SubresourceLoader> ResourceLoadScheduler::scheduleSubresourceLoad(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, ResourceLoadPriority priority, SecurityCheckPolicy securityCheck, 87 bool sendResourceLoadCallbacks, bool shouldContentSniff, const String& optionalOutgoingReferrer )88 { 89 RefPtr<SubresourceLoader> loader = SubresourceLoader::create(frame, client, request, securityCheck, sendResourceLoadCallbacks, shouldContentSniff, optionalOutgoingReferrer );87 bool sendResourceLoadCallbacks, bool shouldContentSniff, const String& optionalOutgoingReferrer, bool shouldBufferData) 88 { 89 RefPtr<SubresourceLoader> loader = SubresourceLoader::create(frame, client, request, securityCheck, sendResourceLoadCallbacks, shouldContentSniff, optionalOutgoingReferrer, shouldBufferData); 90 90 if (loader) 91 91 scheduleLoad(loader.get(), priority); -
trunk/Source/WebCore/loader/ResourceLoadScheduler.h
r82951 r86290 51 51 friend ResourceLoadScheduler* resourceLoadScheduler(); 52 52 53 PassRefPtr<SubresourceLoader> scheduleSubresourceLoad(Frame*, SubresourceLoaderClient*, const ResourceRequest&, ResourceLoadPriority = ResourceLoadPriorityLow, SecurityCheckPolicy = DoSecurityCheck, bool sendResourceLoadCallbacks = true, bool shouldContentSniff = true, const String& optionalOutgoingReferrer = String() );53 PassRefPtr<SubresourceLoader> scheduleSubresourceLoad(Frame*, SubresourceLoaderClient*, const ResourceRequest&, ResourceLoadPriority = ResourceLoadPriorityLow, SecurityCheckPolicy = DoSecurityCheck, bool sendResourceLoadCallbacks = true, bool shouldContentSniff = true, const String& optionalOutgoingReferrer = String(), bool shouldBufferData = true); 54 54 PassRefPtr<NetscapePlugInStreamLoader> schedulePluginStreamLoad(Frame*, NetscapePlugInStreamLoaderClient*, const ResourceRequest&); 55 55 void addMainResourceLoad(ResourceLoader*); -
trunk/Source/WebCore/loader/SubresourceLoader.cpp
r85030 r86290 62 62 } 63 63 64 PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks, bool shouldContentSniff, const String& optionalOutgoingReferrer )64 PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks, bool shouldContentSniff, const String& optionalOutgoingReferrer, bool shouldBufferData) 65 65 { 66 66 if (!frame) … … 101 101 102 102 RefPtr<SubresourceLoader> subloader(adoptRef(new SubresourceLoader(frame, client, sendResourceLoadCallbacks, shouldContentSniff))); 103 subloader->setShouldBufferData(shouldBufferData); 103 104 subloader->documentLoader()->addSubresourceLoader(subloader.get()); 104 105 if (!subloader->init(newRequest)) -
trunk/Source/WebCore/loader/SubresourceLoader.h
r84260 r86290 42 42 class SubresourceLoader : public ResourceLoader { 43 43 public: 44 static PassRefPtr<SubresourceLoader> create(Frame*, SubresourceLoaderClient*, const ResourceRequest&, SecurityCheckPolicy = DoSecurityCheck, bool sendResourceLoadCallbacks = true, bool shouldContentSniff = true, const String& optionalOutgoingReferrer = String() );44 static PassRefPtr<SubresourceLoader> create(Frame*, SubresourceLoaderClient*, const ResourceRequest&, SecurityCheckPolicy = DoSecurityCheck, bool sendResourceLoadCallbacks = true, bool shouldContentSniff = true, const String& optionalOutgoingReferrer = String(), bool shouldBufferData = true); 45 45 46 46 void clearClient() { m_client = 0; } -
trunk/Source/WebCore/loader/ThreadableLoader.h
r76248 r86290 56 56 57 57 struct ThreadableLoaderOptions { 58 ThreadableLoaderOptions() : sendLoadCallbacks(false), sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(DenyCrossOriginRequests) { }58 ThreadableLoaderOptions() : sendLoadCallbacks(false), sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(DenyCrossOriginRequests), shouldBufferData(true) { } 59 59 bool sendLoadCallbacks; 60 60 bool sniffContent; … … 62 62 bool forcePreflight; // If AccessControl is used, whether to force a preflight. 63 63 CrossOriginRequestPolicy crossOriginRequestPolicy; 64 bool shouldBufferData; 64 65 }; 65 66 -
trunk/Source/WebKit/chromium/ChangeLog
r86278 r86290 1 2011-05-11 Antoine Labour <piman@chromium.org> 2 3 Reviewed by David Levin. 4 5 Don't buffer data for resources loaded by AssociatedURLLoader. 6 https://bugs.webkit.org/show_bug.cgi?id=60656 7 8 * src/AssociatedURLLoader.cpp: 9 (WebKit::AssociatedURLLoader::loadAsynchronously): set shouldBufferData to false in ThreadableLoaderOptions 10 1 11 2011-05-11 Nat Duca <nduca@chromium.org> 2 12 -
trunk/Source/WebKit/chromium/src/AssociatedURLLoader.cpp
r84260 r86290 211 211 options.forcePreflight = m_options.forcePreflight; 212 212 options.crossOriginRequestPolicy = static_cast<WebCore::CrossOriginRequestPolicy>(m_options.crossOriginRequestPolicy); 213 options.shouldBufferData = false; 213 214 214 215 const ResourceRequest& webcoreRequest = request.toResourceRequest();
Note: See TracChangeset
for help on using the changeset viewer.