| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. |
| 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 --m_requestCount; | 762 --m_requestCount; |
| 763 ASSERT(m_requestCount > -1); | 763 ASSERT(m_requestCount > -1); |
| 764 } | 764 } |
| 765 | 765 |
| 766 void CachedResourceLoader::preload(CachedResource::Type type, ResourceRequest& r
equest, const String& charset, bool referencedFromBody) | 766 void CachedResourceLoader::preload(CachedResource::Type type, ResourceRequest& r
equest, const String& charset, bool referencedFromBody) |
| 767 { | 767 { |
| 768 // FIXME: Rip this out when we are sure it is no longer necessary (even for
mobile). | 768 // FIXME: Rip this out when we are sure it is no longer necessary (even for
mobile). |
| 769 UNUSED_PARAM(referencedFromBody); | 769 UNUSED_PARAM(referencedFromBody); |
| 770 | 770 |
| 771 bool delaySubresourceLoad = true; | 771 bool delaySubresourceLoad = true; |
| 772 #if PLATFORM(IOS) || PLATFORM(CHROMIUM) | 772 #if PLATFORM(IOS) |
| 773 delaySubresourceLoad = false; | 773 delaySubresourceLoad = false; |
| 774 #endif | 774 #endif |
| 775 if (delaySubresourceLoad) { | 775 if (delaySubresourceLoad) { |
| 776 bool hasRendering = m_document->body() && m_document->body()->renderer()
; | 776 bool hasRendering = m_document->body() && m_document->body()->renderer()
; |
| 777 bool canBlockParser = type == CachedResource::Script || type == CachedRe
source::CSSStyleSheet; | 777 bool canBlockParser = type == CachedResource::Script || type == CachedRe
source::CSSStyleSheet; |
| 778 if (!hasRendering && !canBlockParser) { | 778 if (!hasRendering && !canBlockParser) { |
| 779 // Don't preload subresources that can't block the parser before we
have something to draw. | 779 // Don't preload subresources that can't block the parser before we
have something to draw. |
| 780 // This helps prevent preloads from delaying first display when band
width is limited. | 780 // This helps prevent preloads from delaying first display when band
width is limited. |
| 781 PendingPreload pendingPreload = { type, request, charset }; | 781 PendingPreload pendingPreload = { type, request, charset }; |
| 782 m_pendingPreloads.append(pendingPreload); | 782 m_pendingPreloads.append(pendingPreload); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 info.addMember(m_pendingPreloads); | 926 info.addMember(m_pendingPreloads); |
| 927 } | 927 } |
| 928 | 928 |
| 929 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions(
) | 929 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions(
) |
| 930 { | 930 { |
| 931 static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData
, AllowStoredCredentials, AskClientForCrossOriginCredentials, DoSecurityCheck); | 931 static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData
, AllowStoredCredentials, AskClientForCrossOriginCredentials, DoSecurityCheck); |
| 932 return options; | 932 return options; |
| 933 } | 933 } |
| 934 | 934 |
| 935 } | 935 } |
| OLD | NEW |