[BlackBerry] Add cookie database API
authoranilsson@rim.com <anilsson@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 13:34:15 +0000 (13:34 +0000)
committeranilsson@rim.com <anilsson@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 13:34:15 +0000 (13:34 +0000)
commit0dae84bc52678fc8f8746b84be12cb2499375e3a
treeefa547d10a65f015abd0dc04458bbbc8c46a373f
parentf7315d5351cdb70c4b9dbfe5e560ed1340c976ae
[BlackBerry] Add cookie database API
https://bugs.webkit.org/show_bug.cgi?id=97102

Reviewed by Antonio Gomes.

Source/WebCore:

Add a CookieManager method that takes a list of strings to parse
instead of just one string. Expose CookieParser::parseOneCookie.

Reviewed internally by Otto D. Cheung.

No change in behavior, no new tests.

* platform/blackberry/CookieManager.cpp:
(WebCore::CookieManager::setCookies):
(WebCore):
* platform/blackberry/CookieManager.h:
* platform/blackberry/CookieParser.cpp:
(WebCore::CookieParser::parseOneCookie):
(WebCore):
* platform/blackberry/CookieParser.h:
(CookieParser):

Source/WebKit:

Add cookie database file to build system.

Reviewed internally by Otto D. Cheung.

* PlatformBlackBerry.cmake:

Source/WebKit/blackberry:

The cookie database is exposed through WebCookieJar, which has only two
methods: cookies() and setCookies().

Also add a new WebString::fromUTF8 overload that takes a const char*
and a length, in order to avoid a strlen call when converting from
other string classes to WebString. This is useful for callers of the
new cookie API when converting cookies to WebString.

Reviewed internally by Otto D. Cheung.

PR 209282

* Api/WebCookieJar.cpp: Added.
(WebKit):
(BlackBerry::WebKit::WebCookieJar::WebCookieJar):
(BlackBerry::WebKit::WebCookieJar::cookies):
(BlackBerry::WebKit::WebCookieJar::setCookies):
* Api/WebCookieJar.h: Added.
(WebKit):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::~WebPagePrivate):
(BlackBerry::WebKit::WebPage::cookieJar):
(WebKit):
* Api/WebPage.h:
(WebKit):
* Api/WebPage_p.h:
(WebKit):
(WebPagePrivate):
* Api/WebString.cpp:
(BlackBerry::WebKit::WebString::fromUtf8):
(WebKit):
* Api/WebString.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/blackberry/CookieManager.cpp
Source/WebCore/platform/blackberry/CookieManager.h
Source/WebCore/platform/blackberry/CookieParser.cpp
Source/WebCore/platform/blackberry/CookieParser.h
Source/WebKit/ChangeLog
Source/WebKit/PlatformBlackBerry.cmake
Source/WebKit/blackberry/Api/WebCookieJar.cpp [new file with mode: 0644]
Source/WebKit/blackberry/Api/WebCookieJar.h [new file with mode: 0644]
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/Api/WebPage.h
Source/WebKit/blackberry/Api/WebPage_p.h
Source/WebKit/blackberry/Api/WebString.cpp
Source/WebKit/blackberry/Api/WebString.h
Source/WebKit/blackberry/ChangeLog