Changeset 84373 in webkit


Ignore:
Timestamp:
Apr 20, 2011 7:46:52 AM (13 years ago)
Author:
benjamin.poulain@nokia.com
Message:

[Qt] Clean the style of our cookie methods
https://bugs.webkit.org/show_bug.cgi?id=58987

Reviewed by Andreas Kling.

Got rid of the variables named "u" in favor just converting the url when needed.

  • platform/qt/CookieJarQt.cpp:

(WebCore::setCookies): The variable p was unused.
The ::toAscii() depends on the default codec, use toLatin1() instead.
(WebCore::cookies): foreach() should use const reference.
(WebCore::cookieRequestHeaderFieldValue):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84371 r84373  
     12011-04-20  Benjamin Poulain  <benjamin.poulain@nokia.com>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] Clean the style of our cookie methods
     6        https://bugs.webkit.org/show_bug.cgi?id=58987
     7
     8        Got rid of the variables named "u" in favor just converting the url when needed.
     9
     10        * platform/qt/CookieJarQt.cpp:
     11        (WebCore::setCookies): The variable p was unused.
     12        The ::toAscii() depends on the default codec, use toLatin1() instead.
     13        (WebCore::cookies): foreach() should use const reference.
     14        (WebCore::cookieRequestHeaderFieldValue):
     15
    1162011-04-19  Mihai Parparita  <mihaip@chromium.org>
    217
  • trunk/Source/WebCore/platform/qt/CookieJarQt.cpp

    r81961 r84373  
    6060void setCookies(Document* document, const KURL& url, const String& value)
    6161{
    62     QUrl u(url);
    63     QUrl p(document->firstPartyForCookies());
    6462    QNetworkCookieJar* jar = cookieJar(document);
    6563    if (!jar)
    6664        return;
    6765
    68     QList<QNetworkCookie> cookies = QNetworkCookie::parseCookies(QString(value).toAscii());
     66    QList<QNetworkCookie> cookies = QNetworkCookie::parseCookies(QString(value).toLatin1());
    6967    QList<QNetworkCookie>::Iterator it = cookies.begin();
    7068    while (it != cookies.end()) {
     
    7472            ++it;
    7573    }
    76     jar->setCookiesFromUrl(cookies, u);
     74    jar->setCookiesFromUrl(cookies, QUrl(url));
    7775}
    7876
    7977String cookies(const Document* document, const KURL& url)
    8078{
    81     QUrl u(url);
    8279    QNetworkCookieJar* jar = cookieJar(document);
    8380    if (!jar)
    8481        return String();
    8582
    86     QList<QNetworkCookie> cookies = jar->cookiesForUrl(u);
     83    QList<QNetworkCookie> cookies = jar->cookiesForUrl(QUrl(url));
    8784    if (cookies.isEmpty())
    8885        return String();
    8986
    9087    QStringList resultCookies;
    91     foreach (QNetworkCookie networkCookie, cookies) {
     88    foreach (const QNetworkCookie& networkCookie, cookies) {
    9289        if (networkCookie.isHttpOnly())
    9390            continue;
     
    10097String cookieRequestHeaderFieldValue(const Document* document, const KURL &url)
    10198{
    102     QUrl u(url);
    10399    QNetworkCookieJar* jar = cookieJar(document);
    104100    if (!jar)
    105101        return String();
    106102
    107     QList<QNetworkCookie> cookies = jar->cookiesForUrl(u);
     103    QList<QNetworkCookie> cookies = jar->cookiesForUrl(QUrl(url));
    108104    if (cookies.isEmpty())
    109105        return String();
Note: See TracChangeset for help on using the changeset viewer.