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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 // If fetching a resource with a different 'CORS enabled' flag, reload. | 904 // If fetching a resource with a different 'CORS enabled' flag, reload. |
905 if (type != Resource::MainResource && options.corsEnabled != existingResourc
e->options().corsEnabled) | 905 if (type != Resource::MainResource && options.corsEnabled != existingResourc
e->options().corsEnabled) |
906 return Reload; | 906 return Reload; |
907 | 907 |
908 // If credentials were sent with the previous request and won't be | 908 // If credentials were sent with the previous request and won't be |
909 // with this one, or vice versa, re-fetch the resource. | 909 // with this one, or vice versa, re-fetch the resource. |
910 // | 910 // |
911 // This helps with the case where the server sends back | 911 // This helps with the case where the server sends back |
912 // "Access-Control-Allow-Origin: *" all the time, but some of the | 912 // "Access-Control-Allow-Origin: *" all the time, but some of the |
913 // client's requests are made without CORS and some with. | 913 // client's requests are made without CORS and some with. |
914 if (existingResource->resourceRequest().allowCookies() != request.allowCooki
es()) { | 914 if (existingResource->resourceRequest().allowStoredCredentials() != request.
allowStoredCredentials()) { |
915 WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy r
eloading due to difference in credentials settings."); | 915 WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy r
eloading due to difference in credentials settings."); |
916 return Reload; | 916 return Reload; |
917 } | 917 } |
918 | 918 |
919 // During the initial load, avoid loading the same resource multiple times f
or a single document, | 919 // During the initial load, avoid loading the same resource multiple times f
or a single document, |
920 // even if the cache policies would tell us to. Raw resources are exempted. | 920 // even if the cache policies would tell us to. Raw resources are exempted. |
921 if (type != Resource::Raw && document() && !document()->loadEventFinished()
&& m_validatedURLs.contains(existingResource->url())) | 921 if (type != Resource::Raw && document() && !document()->loadEventFinished()
&& m_validatedURLs.contains(existingResource->url())) |
922 return Use; | 922 return Use; |
923 | 923 |
924 // CachePolicyReload always reloads | 924 // CachePolicyReload always reloads |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 case Revalidate: | 1399 case Revalidate: |
1400 ++m_revalidateCount; | 1400 ++m_revalidateCount; |
1401 return; | 1401 return; |
1402 case Use: | 1402 case Use: |
1403 ++m_useCount; | 1403 ++m_useCount; |
1404 return; | 1404 return; |
1405 } | 1405 } |
1406 } | 1406 } |
1407 | 1407 |
1408 } | 1408 } |
OLD | NEW |