| 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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 // with this one, or vice versa, re-fetch the resource. | 853 // with this one, or vice versa, re-fetch the resource. |
| 854 // | 854 // |
| 855 // This helps with the case where the server sends back | 855 // This helps with the case where the server sends back |
| 856 // "Access-Control-Allow-Origin: *" all the time, but some of the | 856 // "Access-Control-Allow-Origin: *" all the time, but some of the |
| 857 // client's requests are made without CORS and some with. | 857 // client's requests are made without CORS and some with. |
| 858 if (existingResource->resourceRequest().allowCookies() != request.allowCooki
es()) { | 858 if (existingResource->resourceRequest().allowCookies() != request.allowCooki
es()) { |
| 859 LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloa
ding due to difference in credentials settings."); | 859 LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloa
ding due to difference in credentials settings."); |
| 860 return Reload; | 860 return Reload; |
| 861 } | 861 } |
| 862 | 862 |
| 863 // During the initial load, avoid loading the same resource multiple times f
or a single document, even if the cache policies would tell us to. | 863 // During the initial load, avoid loading the same resource multiple times f
or a single document, |
| 864 if (document() && !document()->loadEventFinished() && m_validatedURLs.contai
ns(existingResource->url())) | 864 // even if the cache policies would tell us to. Raw resources are exempted. |
| 865 if (type != Resource::Raw && document() && !document()->loadEventFinished()
&& m_validatedURLs.contains(existingResource->url())) |
| 865 return Use; | 866 return Use; |
| 866 | 867 |
| 867 // CachePolicyReload always reloads | 868 // CachePolicyReload always reloads |
| 868 if (context().cachePolicy(type) == CachePolicyReload) { | 869 if (context().cachePolicy(type) == CachePolicyReload) { |
| 869 LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloa
ding due to CachePolicyReload."); | 870 LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloa
ding due to CachePolicyReload."); |
| 870 return Reload; | 871 return Reload; |
| 871 } | 872 } |
| 872 | 873 |
| 873 // We'll try to reload the resource if it failed last time. | 874 // We'll try to reload the resource if it failed last time. |
| 874 if (existingResource->errorOccurred()) { | 875 if (existingResource->errorOccurred()) { |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 } | 1321 } |
| 1321 #endif | 1322 #endif |
| 1322 | 1323 |
| 1323 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() | 1324 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() |
| 1324 { | 1325 { |
| 1325 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon
tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF
orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul
tOriginRestrictionsForType, DocumentContext)); | 1326 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon
tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF
orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul
tOriginRestrictionsForType, DocumentContext)); |
| 1326 return options; | 1327 return options; |
| 1327 } | 1328 } |
| 1328 | 1329 |
| 1329 } | 1330 } |
| OLD | NEW |