[BlackBerry]Cookies shouldn't be set into each of webcore's request and platform...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2012 08:24:37 +0000 (08:24 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2012 08:24:37 +0000 (08:24 +0000)
commitb5c6efc2e663e8a26bc6969d79f252d4dd8d61a6
treec9a0445776ebb586d6238c2c6318ce86aa6cd7e1
parenta9511b7061ef66b065c0ee1cae565864fd94238c
[BlackBerry]Cookies shouldn't be set into each of webcore's request and platform's request. And this makes a regression.
https://bugs.webkit.org/show_bug.cgi?id=80800

Source/WebCore:

FrameLoaderClientBlackBerry::dispatchWillSendRequest sets cookies to resourceRequest's header
list to show cookies in inspector. And NetworkManager::startJob will set cookies to platformRequest's
m_cookieData again. So cookies are set two times. This causes performance issue.

Moreover, platformRequest will copy cookies from the resourceRequest. And then platformRequest has
the same cookies in its header list and m_cookieData. Network will use header list's cookies which
are output as latin1 only. This causes the regression of https://bugs.webkit.org/show_bug.cgi?id=80307.

Now, set cookies in initializePlatformRequest to ensure setting cookies only once.

Patch by Jason Liu <jason.liu@torchmobile.com.cn> on 2012-03-20
Reviewed by George Staikos.

Test: http/tests/cookies/resources/setUtf8Cookies.php

* platform/network/blackberry/NetworkManager.cpp:
(WebCore::NetworkManager::startJob):
* platform/network/blackberry/ResourceRequest.h:
(ResourceRequest):
* platform/network/blackberry/ResourceRequestBlackBerry.cpp:
(WebCore::ResourceRequest::initializePlatformRequest):

Source/WebKit/blackberry:

Patch by Jason Liu <jason.liu@torchmobile.com.cn> on 2012-03-20
Reviewed by George Staikos.

* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForNavigationAction):
(WebCore::FrameLoaderClientBlackBerry::dispatchWillSendRequest):
(WebCore::FrameLoaderClientBlackBerry::decidePolicyForExternalLoad):

LayoutTests:

Patch by Jason Liu <jason.liu@torchmobile.com.cn> on 2012-03-20
Reviewed by George Staikos.

* http/tests/cookies/resources/setUtf8Cookies-expected.txt: Added.
* http/tests/cookies/resources/setUtf8Cookies-result.php: Added.
* http/tests/cookies/resources/setUtf8Cookies.php: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/cookies/resources/setUtf8Cookies-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cookies/resources/setUtf8Cookies-result.php [new file with mode: 0644]
LayoutTests/http/tests/cookies/resources/setUtf8Cookies.php [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/network/blackberry/NetworkManager.cpp
Source/WebCore/platform/network/blackberry/ResourceRequest.h
Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp