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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
700 // We already have a preload going for this URL. | 700 // We already have a preload going for this URL. |
701 if (forPreload && existingResource->isPreloaded()) | 701 if (forPreload && existingResource->isPreloaded()) |
702 return Use; | 702 return Use; |
703 | 703 |
704 // If the same URL has been loaded as a different type, we need to reload. | 704 // If the same URL has been loaded as a different type, we need to reload. |
705 if (existingResource->type() != type) { | 705 if (existingResource->type() != type) { |
706 LOG(ResourceLoading, "CachedResourceLoader::determineRevalidationPolicy reloading due to type mismatch."); | 706 LOG(ResourceLoading, "CachedResourceLoader::determineRevalidationPolicy reloading due to type mismatch."); |
707 return Reload; | 707 return Reload; |
708 } | 708 } |
709 | 709 |
710 // Do not load from cache if images are not enabled. The load for this image will be blocked | |
711 // in CachedImage::load. | |
712 if (CachedResourceRequest::DeferredByClient == defer) | |
713 return Reload; | |
714 | |
710 // Always use data uris. | 715 // Always use data uris. |
711 // FIXME: Extend this to non-images. | 716 // FIXME: Extend this to non-images. |
712 if (type == CachedResource::ImageResource && request.url().protocolIsData()) | 717 if (type == CachedResource::ImageResource && request.url().protocolIsData()) |
abarth-chromium
2013/06/13 04:38:51
Ah, interesting.
| |
713 return Use; | 718 return Use; |
714 | 719 |
715 if (!existingResource->canReuse(request)) | 720 if (!existingResource->canReuse(request)) |
716 return Reload; | 721 return Reload; |
717 | 722 |
718 // Certain requests (e.g., XHRs) might have manually set headers that requir e revalidation. | 723 // Certain requests (e.g., XHRs) might have manually set headers that requir e revalidation. |
719 // FIXME: In theory, this should be a Revalidate case. In practice, the Memo ryCache revalidation path assumes a whole bunch | 724 // FIXME: In theory, this should be a Revalidate case. In practice, the Memo ryCache revalidation path assumes a whole bunch |
720 // of things about how revalidation works that manual headers violate, so pu nt to Reload instead. | 725 // of things about how revalidation works that manual headers violate, so pu nt to Reload instead. |
721 if (request.isConditional()) | 726 if (request.isConditional()) |
722 return Reload; | 727 return Reload; |
723 | 728 |
724 // Do not load from cache if images are not enabled. The load for this image will be blocked | |
725 // in CachedImage::load. | |
726 if (CachedResourceRequest::DeferredByClient == defer) | |
727 return Reload; | |
728 | |
729 // Don't reload resources while pasting. | 729 // Don't reload resources while pasting. |
730 if (m_allowStaleResources) | 730 if (m_allowStaleResources) |
731 return Use; | 731 return Use; |
732 | 732 |
733 // Alwaus use preloads. | 733 // Alwaus use preloads. |
734 if (existingResource->isPreloaded()) | 734 if (existingResource->isPreloaded()) |
735 return Use; | 735 return Use; |
736 | 736 |
737 // CachePolicyHistoryBuffer uses the cache no matter what. | 737 // CachePolicyHistoryBuffer uses the cache no matter what. |
738 if (cachePolicy(type) == CachePolicyHistoryBuffer) | 738 if (cachePolicy(type) == CachePolicyHistoryBuffer) |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1110 info.addMember(m_garbageCollectDocumentResourcesTimer, "garbageCollectDocume ntResourcesTimer"); | 1110 info.addMember(m_garbageCollectDocumentResourcesTimer, "garbageCollectDocume ntResourcesTimer"); |
1111 } | 1111 } |
1112 | 1112 |
1113 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions( ) | 1113 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions( ) |
1114 { | 1114 { |
1115 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy)); | 1115 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy)); |
1116 return options; | 1116 return options; |
1117 } | 1117 } |
1118 | 1118 |
1119 } | 1119 } |
OLD | NEW |