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
rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. |
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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 bool hasMaxAge = std::isfinite(response.cacheControlMaxAge()); | 335 bool hasMaxAge = std::isfinite(response.cacheControlMaxAge()); |
336 bool hasExpires = std::isfinite(response.expires()); | 336 bool hasExpires = std::isfinite(response.expires()); |
337 // TODO: consider catching Cache-Control "private" and "public" here. | 337 // TODO: consider catching Cache-Control "private" and "public" here. |
338 if (!hasMaxAge && !hasExpires) | 338 if (!hasMaxAge && !hasExpires) |
339 return false; | 339 return false; |
340 } | 340 } |
341 | 341 |
342 return currentAge(response, responseTimestamp) <= freshnessLifetime(response
, responseTimestamp); | 342 return currentAge(response, responseTimestamp) <= freshnessLifetime(response
, responseTimestamp); |
343 } | 343 } |
344 | 344 |
345 const ResourceRequest& Resource::lastResourceRequest() | 345 const ResourceRequest& Resource::lastResourceRequest() const |
346 { | 346 { |
347 if (!m_redirectChain.size()) | 347 if (!m_redirectChain.size()) |
348 return m_resourceRequest; | 348 return m_resourceRequest; |
349 return m_redirectChain.last().m_request; | 349 return m_redirectChain.last().m_request; |
350 } | 350 } |
351 | 351 |
352 void Resource::willSendRequest(ResourceRequest& request, const ResourceResponse&
response) | 352 void Resource::willSendRequest(ResourceRequest& request, const ResourceResponse&
response) |
353 { | 353 { |
354 m_redirectChain.append(RedirectPair(request, response)); | 354 m_redirectChain.append(RedirectPair(request, response)); |
355 m_requestedFromNetworkingLayer = true; | 355 m_requestedFromNetworkingLayer = true; |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 return "ImportResource"; | 995 return "ImportResource"; |
996 case Resource::Media: | 996 case Resource::Media: |
997 return "Media"; | 997 return "Media"; |
998 } | 998 } |
999 ASSERT_NOT_REACHED(); | 999 ASSERT_NOT_REACHED(); |
1000 return "Unknown"; | 1000 return "Unknown"; |
1001 } | 1001 } |
1002 #endif // !LOG_DISABLED | 1002 #endif // !LOG_DISABLED |
1003 | 1003 |
1004 } | 1004 } |
OLD | NEW |