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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 --m_requestCount; | 789 --m_requestCount; |
790 ASSERT(m_requestCount > -1); | 790 ASSERT(m_requestCount > -1); |
791 } | 791 } |
792 | 792 |
793 void CachedResourceLoader::preload(CachedResource::Type type, CachedResourceRequ
est& request, const String& charset, bool referencedFromBody) | 793 void CachedResourceLoader::preload(CachedResource::Type type, CachedResourceRequ
est& request, const String& charset, bool referencedFromBody) |
794 { | 794 { |
795 // FIXME: Rip this out when we are sure it is no longer necessary (even for
mobile). | 795 // FIXME: Rip this out when we are sure it is no longer necessary (even for
mobile). |
796 UNUSED_PARAM(referencedFromBody); | 796 UNUSED_PARAM(referencedFromBody); |
797 | 797 |
798 bool delaySubresourceLoad = true; | 798 bool delaySubresourceLoad = true; |
799 #if PLATFORM(IOS) || PLATFORM(CHROMIUM) | 799 #if PLATFORM(IOS) |
800 delaySubresourceLoad = false; | 800 delaySubresourceLoad = false; |
801 #endif | 801 #endif |
802 if (delaySubresourceLoad) { | 802 if (delaySubresourceLoad) { |
803 bool hasRendering = m_document->body() && m_document->body()->renderer()
; | 803 bool hasRendering = m_document->body() && m_document->body()->renderer()
; |
804 bool canBlockParser = type == CachedResource::Script || type == CachedRe
source::CSSStyleSheet; | 804 bool canBlockParser = type == CachedResource::Script || type == CachedRe
source::CSSStyleSheet; |
805 if (!hasRendering && !canBlockParser) { | 805 if (!hasRendering && !canBlockParser) { |
806 // Don't preload subresources that can't block the parser before we
have something to draw. | 806 // Don't preload subresources that can't block the parser before we
have something to draw. |
807 // This helps prevent preloads from delaying first display when band
width is limited. | 807 // This helps prevent preloads from delaying first display when band
width is limited. |
808 PendingPreload pendingPreload = { type, request, charset }; | 808 PendingPreload pendingPreload = { type, request, charset }; |
809 m_pendingPreloads.append(pendingPreload); | 809 m_pendingPreloads.append(pendingPreload); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 info.addMember(m_pendingPreloads); | 953 info.addMember(m_pendingPreloads); |
954 } | 954 } |
955 | 955 |
956 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions(
) | 956 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions(
) |
957 { | 957 { |
958 static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData
, AllowStoredCredentials, AskClientForCrossOriginCredentials, DoSecurityCheck); | 958 static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData
, AllowStoredCredentials, AskClientForCrossOriginCredentials, DoSecurityCheck); |
959 return options; | 959 return options; |
960 } | 960 } |
961 | 961 |
962 } | 962 } |
OLD | NEW |