| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 | 446 |
| 447 double ResourceResponse::cacheControlMaxAge() const { | 447 double ResourceResponse::cacheControlMaxAge() const { |
| 448 if (!m_cacheControlHeader.parsed) { | 448 if (!m_cacheControlHeader.parsed) { |
| 449 m_cacheControlHeader = | 449 m_cacheControlHeader = |
| 450 parseCacheControlDirectives(m_httpHeaderFields.get(cacheControlHeader), | 450 parseCacheControlDirectives(m_httpHeaderFields.get(cacheControlHeader), |
| 451 m_httpHeaderFields.get(pragmaHeader)); | 451 m_httpHeaderFields.get(pragmaHeader)); |
| 452 } | 452 } |
| 453 return m_cacheControlHeader.maxAge; | 453 return m_cacheControlHeader.maxAge; |
| 454 } | 454 } |
| 455 | 455 |
| 456 double ResourceResponse::cacheControlStaleWhileRevalidate() const { | |
| 457 if (!m_cacheControlHeader.parsed) { | |
| 458 m_cacheControlHeader = | |
| 459 parseCacheControlDirectives(m_httpHeaderFields.get(cacheControlHeader), | |
| 460 m_httpHeaderFields.get(pragmaHeader)); | |
| 461 } | |
| 462 return m_cacheControlHeader.staleWhileRevalidate; | |
| 463 } | |
| 464 | |
| 465 static double parseDateValueInHeader(const HTTPHeaderMap& headers, | 456 static double parseDateValueInHeader(const HTTPHeaderMap& headers, |
| 466 const AtomicString& headerName) { | 457 const AtomicString& headerName) { |
| 467 const AtomicString& headerValue = headers.get(headerName); | 458 const AtomicString& headerValue = headers.get(headerName); |
| 468 if (headerValue.isEmpty()) | 459 if (headerValue.isEmpty()) |
| 469 return std::numeric_limits<double>::quiet_NaN(); | 460 return std::numeric_limits<double>::quiet_NaN(); |
| 470 // This handles all date formats required by RFC2616: | 461 // This handles all date formats required by RFC2616: |
| 471 // Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 | 462 // Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 |
| 472 // Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 | 463 // Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 |
| 473 // Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format | 464 // Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format |
| 474 double dateInMilliseconds = parseDate(headerValue); | 465 double dateInMilliseconds = parseDate(headerValue); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 if (a.resourceLoadTiming() != b.resourceLoadTiming()) | 625 if (a.resourceLoadTiming() != b.resourceLoadTiming()) |
| 635 return false; | 626 return false; |
| 636 if (a.encodedBodyLength() != b.encodedBodyLength()) | 627 if (a.encodedBodyLength() != b.encodedBodyLength()) |
| 637 return false; | 628 return false; |
| 638 if (a.decodedBodyLength() != b.decodedBodyLength()) | 629 if (a.decodedBodyLength() != b.decodedBodyLength()) |
| 639 return false; | 630 return false; |
| 640 return true; | 631 return true; |
| 641 } | 632 } |
| 642 | 633 |
| 643 } // namespace blink | 634 } // namespace blink |
| OLD | NEW |