| 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 { | 731 { |
| 732 ASSERT(resource); | 732 ASSERT(resource); |
| 733 ASSERT(resource->inCache()); | 733 ASSERT(resource->inCache()); |
| 734 ASSERT(resource->isLoaded()); | 734 ASSERT(resource->isLoaded()); |
| 735 ASSERT(resource->canUseCacheValidator()); | 735 ASSERT(resource->canUseCacheValidator()); |
| 736 ASSERT(!resource->resourceToRevalidate()); | 736 ASSERT(!resource->resourceToRevalidate()); |
| 737 | 737 |
| 738 ResourceRequest revalidatingRequest(resource->resourceRequest()); | 738 ResourceRequest revalidatingRequest(resource->resourceRequest()); |
| 739 addAdditionalRequestHeaders(revalidatingRequest, resource->type()); | 739 addAdditionalRequestHeaders(revalidatingRequest, resource->type()); |
| 740 | 740 |
| 741 const String& lastModified = resource->response().httpHeaderField("Last-Modi
fied"); | 741 const AtomicString& lastModified = resource->response().httpHeaderField("Las
t-Modified"); |
| 742 const String& eTag = resource->response().httpHeaderField("ETag"); | 742 const AtomicString& eTag = resource->response().httpHeaderField("ETag"); |
| 743 if (!lastModified.isEmpty() || !eTag.isEmpty()) { | 743 if (!lastModified.isEmpty() || !eTag.isEmpty()) { |
| 744 ASSERT(context().cachePolicy(resource->type()) != CachePolicyReload); | 744 ASSERT(context().cachePolicy(resource->type()) != CachePolicyReload); |
| 745 if (context().cachePolicy(resource->type()) == CachePolicyRevalidate) | 745 if (context().cachePolicy(resource->type()) == CachePolicyRevalidate) |
| 746 revalidatingRequest.setHTTPHeaderField("Cache-Control", "max-age=0")
; | 746 revalidatingRequest.setHTTPHeaderField("Cache-Control", "max-age=0")
; |
| 747 if (!lastModified.isEmpty()) | 747 if (!lastModified.isEmpty()) |
| 748 revalidatingRequest.setHTTPHeaderField("If-Modified-Since", lastModi
fied); | 748 revalidatingRequest.setHTTPHeaderField("If-Modified-Since", lastModi
fied); |
| 749 if (!eTag.isEmpty()) | 749 if (!eTag.isEmpty()) |
| 750 revalidatingRequest.setHTTPHeaderField("If-None-Match", eTag); | 750 revalidatingRequest.setHTTPHeaderField("If-None-Match", eTag); |
| 751 } | 751 } |
| 752 | 752 |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 } | 1320 } |
| 1321 #endif | 1321 #endif |
| 1322 | 1322 |
| 1323 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() | 1323 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() |
| 1324 { | 1324 { |
| 1325 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon
tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF
orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, DocumentC
ontext)); | 1325 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon
tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF
orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, DocumentC
ontext)); |
| 1326 return options; | 1326 return options; |
| 1327 } | 1327 } |
| 1328 | 1328 |
| 1329 } | 1329 } |
| OLD | NEW |