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) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
7 rights reserved. | 7 rights reserved. |
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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 return (creationTime - lastModifiedValue) * 0.1; | 517 return (creationTime - lastModifiedValue) * 0.1; |
518 // If no cache headers are present, the specification leaves the decision to | 518 // If no cache headers are present, the specification leaves the decision to |
519 // the UA. Other browsers seem to opt for 0. | 519 // the UA. Other browsers seem to opt for 0. |
520 return 0; | 520 return 0; |
521 } | 521 } |
522 | 522 |
523 double Resource::freshnessLifetime() const { | 523 double Resource::freshnessLifetime() const { |
524 return blink::freshnessLifetime(response(), m_responseTimestamp); | 524 return blink::freshnessLifetime(response(), m_responseTimestamp); |
525 } | 525 } |
526 | 526 |
527 double Resource::stalenessLifetime() const { | |
528 return response().cacheControlStaleWhileRevalidate(); | |
529 } | |
530 | |
531 static bool canUseResponse(const ResourceResponse& response, | 527 static bool canUseResponse(const ResourceResponse& response, |
532 double responseTimestamp) { | 528 double responseTimestamp) { |
533 if (response.isNull()) | 529 if (response.isNull()) |
534 return false; | 530 return false; |
535 | 531 |
536 // FIXME: Why isn't must-revalidate considered a reason we can't use the | 532 // FIXME: Why isn't must-revalidate considered a reason we can't use the |
537 // response? | 533 // response? |
538 if (response.cacheControlContainsNoCache() || | 534 if (response.cacheControlContainsNoCache() || |
539 response.cacheControlContainsNoStore()) | 535 response.cacheControlContainsNoStore()) |
540 return false; | 536 return false; |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 case Resource::Media: | 1118 case Resource::Media: |
1123 case Resource::Manifest: | 1119 case Resource::Manifest: |
1124 case Resource::Mock: | 1120 case Resource::Mock: |
1125 return false; | 1121 return false; |
1126 } | 1122 } |
1127 NOTREACHED(); | 1123 NOTREACHED(); |
1128 return false; | 1124 return false; |
1129 } | 1125 } |
1130 | 1126 |
1131 } // namespace blink | 1127 } // namespace blink |
OLD | NEW |