Changeset 86290 in webkit


Ignore:
Timestamp:
May 11, 2011 5:28:14 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-05-11 Antoine Labour <piman@chromium.org>

Reviewed by David Levin.

Expose shouldBufferData to ThreadableLoaderOptions to be able to disable buffering of the
loaded resource.
https://bugs.webkit.org/show_bug.cgi?id=60656

  • loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): Pass the shouldBufferData to the resource load scheduler, forcing it to true for the preflight request.
  • loader/ResourceLoadScheduler.cpp: (WebCore::ResourceLoadScheduler::scheduleSubresourceLoad): Pass through shouldBufferData to SubresourceLoader::create
  • loader/ResourceLoadScheduler.h:
  • loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::create): Set shouldBufferData on the newly created loader
  • loader/SubresourceLoader.h:
  • loader/ThreadableLoader.h: (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Add shouldBufferData to the options, defaulting to true.

2011-05-11 Antoine Labour <piman@chromium.org>

Reviewed by David Levin.

Don't buffer data for resources loaded by AssociatedURLLoader.
https://bugs.webkit.org/show_bug.cgi?id=60656

  • src/AssociatedURLLoader.cpp: (WebKit::AssociatedURLLoader::loadAsynchronously): set shouldBufferData to false in ThreadableLoaderOptions
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86289 r86290  
     12011-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
    1282011-05-11  Jay Civelli  <jcivelli@chromium.org>
    229
  • trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp

    r84923 r86290  
    347347        bool sendLoadCallbacks = m_options.sendLoadCallbacks && !m_actualRequest;
    348348        bool sniffContent = m_options.sniffContent && !m_actualRequest;
     349        // Keep buffering the data for the preflight request.
     350        bool shouldBufferData = m_options.shouldBufferData || m_actualRequest;
    349351
    350352        // Clear the loader so that any callbacks from SubresourceLoader::create will not have the old loader.
    351353        m_loader = 0;
    352354        m_loader = resourceLoadScheduler()->scheduleSubresourceLoad(m_document->frame(), this, request, ResourceLoadPriorityMedium, securityCheck, sendLoadCallbacks,
    353                                                                     sniffContent, m_optionalOutgoingReferrer);
     355                                                                    sniffContent, m_optionalOutgoingReferrer, shouldBufferData);
    354356        return;
    355357    }
  • trunk/Source/WebCore/loader/ResourceLoadScheduler.cpp

    r82951 r86290  
    8585
    8686PassRefPtr<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);
    9090    if (loader)
    9191        scheduleLoad(loader.get(), priority);
  • trunk/Source/WebCore/loader/ResourceLoadScheduler.h

    r82951 r86290  
    5151    friend ResourceLoadScheduler* resourceLoadScheduler();
    5252
    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);
    5454    PassRefPtr<NetscapePlugInStreamLoader> schedulePluginStreamLoad(Frame*, NetscapePlugInStreamLoaderClient*, const ResourceRequest&);
    5555    void addMainResourceLoad(ResourceLoader*);
  • trunk/Source/WebCore/loader/SubresourceLoader.cpp

    r85030 r86290  
    6262}
    6363
    64 PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks, bool shouldContentSniff, const String& optionalOutgoingReferrer)
     64PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, SubresourceLoaderClient* client, const ResourceRequest& request, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks, bool shouldContentSniff, const String& optionalOutgoingReferrer, bool shouldBufferData)
    6565{
    6666    if (!frame)
     
    101101
    102102    RefPtr<SubresourceLoader> subloader(adoptRef(new SubresourceLoader(frame, client, sendResourceLoadCallbacks, shouldContentSniff)));
     103    subloader->setShouldBufferData(shouldBufferData);
    103104    subloader->documentLoader()->addSubresourceLoader(subloader.get());
    104105    if (!subloader->init(newRequest))
  • trunk/Source/WebCore/loader/SubresourceLoader.h

    r84260 r86290  
    4242    class SubresourceLoader : public ResourceLoader {
    4343    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);
    4545
    4646        void clearClient() { m_client = 0; }
  • trunk/Source/WebCore/loader/ThreadableLoader.h

    r76248 r86290  
    5656   
    5757    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) { }
    5959        bool sendLoadCallbacks;
    6060        bool sniffContent;
     
    6262        bool forcePreflight;  // If AccessControl is used, whether to force a preflight.
    6363        CrossOriginRequestPolicy crossOriginRequestPolicy;
     64        bool shouldBufferData;
    6465    };
    6566
  • trunk/Source/WebKit/chromium/ChangeLog

    r86278 r86290  
     12011-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
    1112011-05-11  Nat Duca  <nduca@chromium.org>
    212
  • trunk/Source/WebKit/chromium/src/AssociatedURLLoader.cpp

    r84260 r86290  
    211211    options.forcePreflight = m_options.forcePreflight;
    212212    options.crossOriginRequestPolicy = static_cast<WebCore::CrossOriginRequestPolicy>(m_options.crossOriginRequestPolicy);
     213    options.shouldBufferData = false;
    213214
    214215    const ResourceRequest& webcoreRequest = request.toResourceRequest();
Note: See TracChangeset for help on using the changeset viewer.