[WK2][DiskCache] Store common HTTP header names as strings
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 May 2016 23:26:03 +0000 (23:26 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 May 2016 23:26:03 +0000 (23:26 +0000)
commitfe70dfb014989da5cb31711c88795ca656ccd204
tree23d96bcac4a7e05c2f55587ce597cac8deadb79d
parent89586c0067f507dcd470df2c69b8cb63946f820b
[WK2][DiskCache] Store common HTTP header names as strings
https://bugs.webkit.org/show_bug.cgi?id=157326
<rdar://problem/26073498>

Reviewed by Antti Koivisto.

Store common HTTP header names as strings in the disk cache instead of
using their value in the HTTPHeaderName enumeration. Having the disk
cache rely in the HTTPHeaderName enumeration is risky becomes it means
the cached data would become invalid every time someone updates
HTTPHeaderNames.in in WebCore. If someone were to update
HTTPHeaderNames.in without bumping the disk cache version, we would end
up with wrongly recognized HTTP header names after loading responses
from the cache.

* NetworkProcess/cache/NetworkCacheCoders.cpp:
(WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode):
(WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode):
* NetworkProcess/cache/NetworkCacheCoders.h:
* NetworkProcess/cache/NetworkCacheStorage.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/platform/network/HTTPHeaderMap.h
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.h
Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h