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 | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 rights reserved. | 6 rights reserved. |
7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
8 | 8 |
9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 // 304 response for a request that wasn't flagged as a revalidation attempt. | 916 // 304 response for a request that wasn't flagged as a revalidation attempt. |
917 // Normally, successful revalidation will maintain the original response's | 917 // Normally, successful revalidation will maintain the original response's |
918 // status code, but for a manual revalidation the response code remains 304. | 918 // status code, but for a manual revalidation the response code remains 304. |
919 // In this case, the Resource likely has insufficient context to provide a | 919 // In this case, the Resource likely has insufficient context to provide a |
920 // useful cache hit or revalidation. See http://crbug.com/643659 | 920 // useful cache hit or revalidation. See http://crbug.com/643659 |
921 if (request.IsConditional() || | 921 if (request.IsConditional() || |
922 existing_resource->GetResponse().HttpStatusCode() == 304) { | 922 existing_resource->GetResponse().HttpStatusCode() == 304) { |
923 return kReload; | 923 return kReload; |
924 } | 924 } |
925 | 925 |
926 // Don't reload resources while pasting. | |
927 if (allow_stale_resources_) | |
928 return kUse; | |
929 | |
930 if (!fetch_params.Options().CanReuseRequest(existing_resource->Options())) | 926 if (!fetch_params.Options().CanReuseRequest(existing_resource->Options())) |
931 return kReload; | 927 return kReload; |
932 | 928 |
933 // Always use preloads. | 929 // Always use preloads. |
934 if (existing_resource->IsPreloaded()) | 930 if (existing_resource->IsPreloaded()) |
935 return kUse; | 931 return kUse; |
936 | 932 |
| 933 // Don't reload resources while pasting. |
| 934 if (allow_stale_resources_) |
| 935 return kUse; |
| 936 |
937 // WebCachePolicy::ReturnCacheDataElseLoad uses the cache no matter what. | 937 // WebCachePolicy::ReturnCacheDataElseLoad uses the cache no matter what. |
938 if (request.GetCachePolicy() == WebCachePolicy::kReturnCacheDataElseLoad) | 938 if (request.GetCachePolicy() == WebCachePolicy::kReturnCacheDataElseLoad) |
939 return kUse; | 939 return kUse; |
940 | 940 |
941 // Don't reuse resources with Cache-control: no-store. | 941 // Don't reuse resources with Cache-control: no-store. |
942 if (existing_resource->HasCacheControlNoStoreHeader()) { | 942 if (existing_resource->HasCacheControlNoStoreHeader()) { |
943 RESOURCE_LOADING_DVLOG(1) << "ResourceFetcher::determineRevalidationPolicy " | 943 RESOURCE_LOADING_DVLOG(1) << "ResourceFetcher::determineRevalidationPolicy " |
944 "reloading due to Cache-control: no-store."; | 944 "reloading due to Cache-control: no-store."; |
945 return kReload; | 945 return kReload; |
946 } | 946 } |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 visitor->Trace(context_); | 1562 visitor->Trace(context_); |
1563 visitor->Trace(archive_); | 1563 visitor->Trace(archive_); |
1564 visitor->Trace(loaders_); | 1564 visitor->Trace(loaders_); |
1565 visitor->Trace(non_blocking_loaders_); | 1565 visitor->Trace(non_blocking_loaders_); |
1566 visitor->Trace(document_resources_); | 1566 visitor->Trace(document_resources_); |
1567 visitor->Trace(preloads_); | 1567 visitor->Trace(preloads_); |
1568 visitor->Trace(resource_timing_info_map_); | 1568 visitor->Trace(resource_timing_info_map_); |
1569 } | 1569 } |
1570 | 1570 |
1571 } // namespace blink | 1571 } // namespace blink |
OLD | NEW |