Changeset 184690 in webkit
- Timestamp:
- May 20, 2015 7:09:14 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r184676 r184690 1 2015-05-20 Marcos Chavarría Teijeiro <mchavarria@igalia.com> 2 3 Enable disk cache for range requests 4 https://bugs.webkit.org/show_bug.cgi?id=144682 5 6 Reviewed by Antti Koivisto. 7 8 * http/tests/cache/disk-cache/disk-cache-range-expected.txt: Added. Add Test. 9 * http/tests/cache/disk-cache/disk-cache-range.html: Added. 10 * http/tests/cache/disk-cache/resources/generate-response.cgi: Modify script to return 206 and 416 response codes if Range header is present. 11 * platform/gtk/TestExpectations: Remove failing test. 12 1 13 2015-05-20 Chris Fleizach <cfleizach@apple.com> 2 14 -
trunk/LayoutTests/http/tests/cache/disk-cache/resources/generate-response.cgi
r182157 r184690 20 20 } 21 21 22 if ($query->http && $query->param("Range") =~ /bytes=(\d+)-(\d+)/) { 23 24 if ($1 < 6 && $2 < 6) { 25 print "Status: 206\n"; 26 } else { 27 print "Status: 416\n"; 28 } 29 30 $hasStatusCode = 1; 31 } 32 22 33 foreach (@names) { 23 34 next if ($_ eq "uniqueId"); -
trunk/LayoutTests/platform/gtk/TestExpectations
r184561 r184690 2293 2293 webkit.org/b/144763 fast/events/scroll-in-scaled-page-with-overflow-hidden.html 2294 2294 2295 webkit.org/b/144682 http/tests/xmlhttprequest/range-test.html [ Failure ]2296 2297 2295 webkit.org/b/141835 media/video-controls-no-scripting.html [ Failure ] 2298 2296 webkit.org/b/145048 http/tests/misc/bad-charset-alias.html [ Failure ] -
trunk/Source/WebKit2/ChangeLog
r184686 r184690 1 2015-05-20 Marcos Chavarría Teijeiro <mchavarria@igalia.com> 2 3 Enable disk cache for range requests 4 https://bugs.webkit.org/show_bug.cgi?id=144682 5 6 Reviewed by Antti Koivisto. 7 8 Add Range header value to the network cache key constructor so we take 9 into account this value. The 206 response code is also marked to be cached. 10 11 * NetworkProcess/cache/NetworkCache.cpp: 12 (WebKit::NetworkCache::makeCacheKey): 13 (WebKit::NetworkCache::isStatusCodeCacheableByDefault): 14 * NetworkProcess/cache/NetworkCacheKey.cpp: 15 (WebKit::NetworkCache::Key::Key): 16 (WebKit::NetworkCache::Key::operator=): 17 (WebKit::NetworkCache::Key::computeHash): 18 (WebKit::NetworkCache::Key::operator==): 19 (WebKit::NetworkCache::Key::encode): 20 (WebKit::NetworkCache::Key::decode): 21 (WebKit::NetworkCache::Key::stringToHash): Deleted. 22 * NetworkProcess/cache/NetworkCacheKey.h: 23 1 24 2015-05-20 Anders Carlsson <andersca@apple.com> 2 25 -
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp
r184620 r184690 110 110 if (partition.isEmpty()) 111 111 partition = ASCIILiteral("No partition"); 112 return { request.httpMethod(), partition, request.url().string() }; 112 113 // FIXME: This implements minimal Range header disk cache support. We don't parse 114 // ranges so only the same exact range request will be served from the cache. 115 String range = request.httpHeaderField(WebCore::HTTPHeaderName::Range); 116 return { request.httpMethod(), partition, range, request.url().string() }; 113 117 } 114 118 … … 238 242 case 203: // Non-Authoritative Information 239 243 case 204: // No Content 244 case 206: // Partial Content 240 245 case 300: // Multiple Choices 241 246 case 301: // Moved Permanently -
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.cpp
r182432 r184690 41 41 , m_partition(o.m_partition.isolatedCopy()) 42 42 , m_identifier(o.m_identifier.isolatedCopy()) 43 , m_range(o.m_range.isolatedCopy()) 43 44 , m_hash(o.m_hash) 44 45 { 45 46 } 46 47 47 Key::Key(const String& method, const String& partition, const String& identifier)48 Key::Key(const String& method, const String& partition, const String& range, const String& identifier) 48 49 : m_method(method.isolatedCopy()) 49 50 , m_partition(partition.isolatedCopy()) 50 51 , m_identifier(identifier.isolatedCopy()) 52 , m_range(range.isolatedCopy()) 51 53 , m_hash(computeHash()) 52 54 { … … 58 60 m_partition = other.m_partition.isolatedCopy(); 59 61 m_identifier = other.m_identifier.isolatedCopy(); 62 m_range = other.m_range.isolatedCopy(); 60 63 m_hash = other.m_hash; 61 64 return *this; … … 65 68 { 66 69 const uint8_t zero = 0; 70 71 if (string.isNull()) 72 return; 73 67 74 if (string.is8Bit() && string.containsOnlyASCII()) { 68 75 md5.addBytes(string.characters8(), string.length()); … … 83 90 hashString(md5, m_partition); 84 91 hashString(md5, m_identifier); 92 hashString(md5, m_range); 85 93 MD5::Digest hash; 86 94 md5.checksum(hash); … … 122 130 bool Key::operator==(const Key& other) const 123 131 { 124 return m_hash == other.m_hash && m_method == other.m_method && m_partition == other.m_partition && m_identifier == other.m_identifier ;132 return m_hash == other.m_hash && m_method == other.m_method && m_partition == other.m_partition && m_identifier == other.m_identifier && m_range == other.m_range; 125 133 } 126 134 … … 130 138 encoder << m_partition; 131 139 encoder << m_identifier; 140 encoder << m_range; 132 141 encoder << m_hash; 133 142 } … … 135 144 bool Key::decode(Decoder& decoder, Key& key) 136 145 { 137 return decoder.decode(key.m_method) && decoder.decode(key.m_partition) && decoder.decode(key.m_identifier) && decoder.decode(key.m_ hash);146 return decoder.decode(key.m_method) && decoder.decode(key.m_partition) && decoder.decode(key.m_identifier) && decoder.decode(key.m_range) && decoder.decode(key.m_hash); 138 147 } 139 148 -
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.h
r182432 r184690 45 45 Key(const Key&); 46 46 Key(Key&&) = default; 47 Key(const String& method, const String& partition, const String& identifier);47 Key(const String& method, const String& partition, const String& range, const String& identifier); 48 48 49 49 Key& operator=(const Key&); … … 75 75 String m_partition; 76 76 String m_identifier; 77 String m_range; 77 78 HashType m_hash; 78 79 };
Note: See TracChangeset
for help on using the changeset viewer.