Changeset 122629 in webkit


Ignore:
Timestamp:
Jul 13, 2012 2:03:50 PM (12 years ago)
Author:
benjamin@webkit.org
Message:

Always aggressively preload on iOS
https://bugs.webkit.org/show_bug.cgi?id=91276

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-07-13
Reviewed by Simon Fraser.

  • loader/cache/CachedResourceLoader.cpp:

(WebCore::CachedResourceLoader::preload):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122628 r122629  
     12012-07-13  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Always aggressively preload on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=91276
     5
     6        Reviewed by Simon Fraser.
     7
     8        * loader/cache/CachedResourceLoader.cpp:
     9        (WebCore::CachedResourceLoader::preload):
     10
    1112012-07-13  Vineet Chaudhary  <rgf748@motorola.com>
    212
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp

    r121297 r122629  
    729729    UNUSED_PARAM(referencedFromBody);
    730730
    731     bool hasRendering = m_document->body() && m_document->body()->renderer();
    732     bool canBlockParser = type == CachedResource::Script || type == CachedResource::CSSStyleSheet;
    733     if (!hasRendering && !canBlockParser) {
    734         // Don't preload subresources that can't block the parser before we have something to draw.
    735         // This helps prevent preloads from delaying first display when bandwidth is limited.
    736         PendingPreload pendingPreload = { type, request, charset };
    737         m_pendingPreloads.append(pendingPreload);
    738         return;
     731    bool delaySubresourceLoad = true;
     732#if PLATFORM(IOS)
     733    delaySubresourceLoad = false;
     734#endif
     735    if (delaySubresourceLoad) {
     736        bool hasRendering = m_document->body() && m_document->body()->renderer();
     737        bool canBlockParser = type == CachedResource::Script || type == CachedResource::CSSStyleSheet;
     738        if (!hasRendering && !canBlockParser) {
     739            // Don't preload subresources that can't block the parser before we have something to draw.
     740            // This helps prevent preloads from delaying first display when bandwidth is limited.
     741            PendingPreload pendingPreload = { type, request, charset };
     742            m_pendingPreloads.append(pendingPreload);
     743            return;
     744        }
    739745    }
    740746    requestPreload(type, request, charset);
Note: See TracChangeset for help on using the changeset viewer.