| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 5 * Copyright (C) 2009 Google Inc. All rights reserved. | 5 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 | 696 |
| 697 CacheControlHeader parseCacheControlDirectives( | 697 CacheControlHeader parseCacheControlDirectives( |
| 698 const AtomicString& cacheControlValue, | 698 const AtomicString& cacheControlValue, |
| 699 const AtomicString& pragmaValue) { | 699 const AtomicString& pragmaValue) { |
| 700 CacheControlHeader cacheControlHeader; | 700 CacheControlHeader cacheControlHeader; |
| 701 cacheControlHeader.parsed = true; | 701 cacheControlHeader.parsed = true; |
| 702 cacheControlHeader.maxAge = std::numeric_limits<double>::quiet_NaN(); | 702 cacheControlHeader.maxAge = std::numeric_limits<double>::quiet_NaN(); |
| 703 cacheControlHeader.staleWhileRevalidate = | 703 cacheControlHeader.staleWhileRevalidate = |
| 704 std::numeric_limits<double>::quiet_NaN(); | 704 std::numeric_limits<double>::quiet_NaN(); |
| 705 | 705 |
| 706 DEFINE_STATIC_LOCAL(const AtomicString, noCacheDirective, ("no-cache")); | 706 static const char noCacheDirective[] = "no-cache"; |
| 707 DEFINE_STATIC_LOCAL(const AtomicString, noStoreDirective, ("no-store")); | 707 static const char noStoreDirective[] = "no-store"; |
| 708 DEFINE_STATIC_LOCAL(const AtomicString, mustRevalidateDirective, | 708 static const char mustRevalidateDirective[] = "must-revalidate"; |
| 709 ("must-revalidate")); | 709 static const char maxAgeDirective[] = "max-age"; |
| 710 DEFINE_STATIC_LOCAL(const AtomicString, maxAgeDirective, ("max-age")); | 710 static const char staleWhileRevalidateDirective[] = "stale-while-revalidate"; |
| 711 DEFINE_STATIC_LOCAL(const AtomicString, staleWhileRevalidateDirective, | |
| 712 ("stale-while-revalidate")); | |
| 713 | 711 |
| 714 if (!cacheControlValue.isEmpty()) { | 712 if (!cacheControlValue.isEmpty()) { |
| 715 Vector<std::pair<String, String>> directives; | 713 Vector<std::pair<String, String>> directives; |
| 716 parseCacheHeader(cacheControlValue, directives); | 714 parseCacheHeader(cacheControlValue, directives); |
| 717 | 715 |
| 718 size_t directivesSize = directives.size(); | 716 size_t directivesSize = directives.size(); |
| 719 for (size_t i = 0; i < directivesSize; ++i) { | 717 for (size_t i = 0; i < directivesSize; ++i) { |
| 720 // RFC2616 14.9.1: A no-cache directive with a value is only meaningful | 718 // RFC2616 14.9.1: A no-cache directive with a value is only meaningful |
| 721 // for proxy caches. It should be ignored by a browser level cache. | 719 // for proxy caches. It should be ignored by a browser level cache. |
| 722 if (equalIgnoringCase(directives[i].first, noCacheDirective) && | 720 if (equalIgnoringCase(directives[i].first, noCacheDirective) && |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 StringBuilder sb; | 870 StringBuilder sb; |
| 873 sb.append("["); | 871 sb.append("["); |
| 874 sb.append(header); | 872 sb.append(header); |
| 875 sb.append("]"); | 873 sb.append("]"); |
| 876 std::unique_ptr<JSONValue> headerValue = | 874 std::unique_ptr<JSONValue> headerValue = |
| 877 parseJSON(sb.toString(), maxParseDepth); | 875 parseJSON(sb.toString(), maxParseDepth); |
| 878 return JSONArray::from(std::move(headerValue)); | 876 return JSONArray::from(std::move(headerValue)); |
| 879 } | 877 } |
| 880 | 878 |
| 881 } // namespace blink | 879 } // namespace blink |
| OLD | NEW |