[Cocoa] Avoid extra copy of headers dictionary in ResourceResponse::platformLazyInit()
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Jun 2016 14:31:26 +0000 (14:31 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Jun 2016 14:31:26 +0000 (14:31 +0000)
commit6bec391095c7a4e23ec2026a3ed48e14adf8c4c7
tree764747239b6cf35c4ce7fa30b69f757ff22f348b
parent2d3ee5de603750ee8aa249eaeda5431e65be816d
[Cocoa] Avoid extra copy of headers dictionary in ResourceResponse::platformLazyInit()
https://bugs.webkit.org/show_bug.cgi?id=158717

Reviewed by Alex Christensen.

Avoid extra copy of headers dictionary in ResourceResponse::platformLazyInit() by
calling CFHTTPMessageCopyAllHeaderFields() instead of [NSURLResponse allHeaderFields].

CFHTTPMessageCopyAllHeaderFields() creates only 1 copy while
[NSURLResponse allHeaderFields] creates 2 (see <rdar://problem/26778863>).

* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::addToHTTPHeaderMap):
(WebCore::ResourceResponse::platformLazyInit):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202042 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm