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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 bool hasMaxAge = std::isfinite(response.cacheControlMaxAge()); | 342 bool hasMaxAge = std::isfinite(response.cacheControlMaxAge()); |
343 bool hasExpires = std::isfinite(response.expires()); | 343 bool hasExpires = std::isfinite(response.expires()); |
344 // TODO: consider catching Cache-Control "private" and "public" here. | 344 // TODO: consider catching Cache-Control "private" and "public" here. |
345 if (!hasMaxAge && !hasExpires) | 345 if (!hasMaxAge && !hasExpires) |
346 return false; | 346 return false; |
347 } | 347 } |
348 | 348 |
349 return currentAge(response, responseTimestamp) <= freshnessLifetime(response
, responseTimestamp); | 349 return currentAge(response, responseTimestamp) <= freshnessLifetime(response
, responseTimestamp); |
350 } | 350 } |
351 | 351 |
352 const ResourceRequest& Resource::lastResourceRequest() | 352 const ResourceRequest& Resource::lastResourceRequest() const |
353 { | 353 { |
354 if (!m_redirectChain.size()) | 354 if (!m_redirectChain.size()) |
355 return m_resourceRequest; | 355 return m_resourceRequest; |
356 return m_redirectChain.last().m_request; | 356 return m_redirectChain.last().m_request; |
357 } | 357 } |
358 | 358 |
359 void Resource::willSendRequest(ResourceRequest& request, const ResourceResponse&
response) | 359 void Resource::willSendRequest(ResourceRequest& request, const ResourceResponse&
response) |
360 { | 360 { |
361 m_redirectChain.append(RedirectPair(request, response)); | 361 m_redirectChain.append(RedirectPair(request, response)); |
362 m_requestedFromNetworkingLayer = true; | 362 m_requestedFromNetworkingLayer = true; |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 return "ImportResource"; | 1005 return "ImportResource"; |
1006 case Resource::Media: | 1006 case Resource::Media: |
1007 return "Media"; | 1007 return "Media"; |
1008 } | 1008 } |
1009 ASSERT_NOT_REACHED(); | 1009 ASSERT_NOT_REACHED(); |
1010 return "Unknown"; | 1010 return "Unknown"; |
1011 } | 1011 } |
1012 #endif // !LOG_DISABLED | 1012 #endif // !LOG_DISABLED |
1013 | 1013 |
1014 } | 1014 } |
OLD | NEW |