Changeset 54352 in webkit


Ignore:
Timestamp:
Feb 4, 2010 10:09:15 AM (8 years ago)
Author:
xan@webkit.org
Message:

2010-02-04 Xan Lopez <xlopez@igalia.com>

Reviewed by Gustavo Noronha.

Bump minimum libsoup requirement to 2.29.90

  • configure.ac:

WebCore:

2010-02-04 Xan Lopez <xlopez@igalia.com>

Reviewed by Gustavo Noronha.

Set first party URI in all SoupMessages. This allows libsoup to
implement a "no third party cookies" policy in case it wants
to. Also start a non-JSC-specific, gtk-specific GOwnPtr module and
use it for SoupURI.

  • platform/network/soup/CookieJarSoup.cpp: (WebCore::setCookies):
  • platform/network/soup/ResourceHandleSoup.cpp: (WebCore::restartedCallback): (WebCore::startHttp):
  • platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::toSoupMessage): (WebCore::ResourceRequest::updateFromSoupMessage):
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r54260 r54352  
     12010-02-04  Xan Lopez  <xlopez@igalia.com>
     2
     3        Reviewed by Gustavo Noronha.
     4
     5        Bump minimum libsoup requirement to 2.29.90
     6
     7        * configure.ac:
     8
    192010-02-02  Gustavo Noronha Silva  <gns@gnome.org>
    210
  • trunk/WebCore/ChangeLog

    r54351 r54352  
     12010-02-04  Xan Lopez  <xlopez@igalia.com>
     2
     3        Reviewed by Gustavo Noronha.
     4
     5        Set first party URI in all SoupMessages. This allows libsoup to
     6        implement a "no third party cookies" policy in case it wants
     7        to. Also start a non-JSC-specific, gtk-specific GOwnPtr module and
     8        use it for SoupURI.
     9
     10        * platform/network/soup/CookieJarSoup.cpp:
     11        (WebCore::setCookies):
     12        * platform/network/soup/ResourceHandleSoup.cpp:
     13        (WebCore::restartedCallback):
     14        (WebCore::startHttp):
     15        * platform/network/soup/ResourceRequestSoup.cpp:
     16        (WebCore::ResourceRequest::toSoupMessage):
     17        (WebCore::ResourceRequest::updateFromSoupMessage):
     18
    1192010-02-04  Pavel Feldman  <pfeldman@chromium.org>
    220
  • trunk/WebCore/platform/network/soup/CookieJarSoup.cpp

    r47363 r54352  
    2525#include "CString.h"
    2626#include "Document.h"
     27#include "GOwnPtrGtk.h"
    2728#include "KURL.h"
    2829
     
    5556}
    5657
    57 void setCookies(Document* /*document*/, const KURL& url, const String& value)
     58void setCookies(Document* document, const KURL& url, const String& value)
    5859{
    5960    SoupCookieJar* jar = defaultCookieJar();
     
    6162        return;
    6263
    63     SoupURI* origin = soup_uri_new(url.string().utf8().data());
     64    GOwnPtr<SoupURI> origin(soup_uri_new(url.string().utf8().data()));
     65    GOwnPtr<SoupURI> firstParty(soup_uri_new(document->firstPartyForCookies().string().utf8().data()));
    6466
    65     soup_cookie_jar_set_cookie(jar, origin, value.utf8().data());
    66     soup_uri_free(origin);
     67    soup_cookie_jar_set_cookie_with_first_party(jar,
     68                                                origin.get(),
     69                                                firstParty.get(),
     70                                                value.utf8().data());
    6771}
    6872
  • trunk/WebCore/platform/network/soup/ResourceHandleSoup.cpp

    r52791 r54352  
    3535#include "FileSystem.h"
    3636#include "Frame.h"
     37#include "GOwnPtrGtk.h"
    3738#include "HTTPParsers.h"
    3839#include "Logging.h"
     
    210211    if (d->client())
    211212        d->client()->willSendRequest(handle, request, response);
     213
     214    // Update the first party in case the base URL changed with the redirect
     215    String firstPartyString = request.firstPartyForCookies().string();
     216    if (!firstPartyString.isEmpty()) {
     217        GOwnPtr<SoupURI> firstParty(soup_uri_new(firstPartyString.utf8().data()));
     218        soup_message_set_first_party(d->m_msg, firstParty.get());
     219    }
    212220}
    213221
     
    485493    g_signal_connect(d->m_msg, "got-chunk", G_CALLBACK(gotChunkCallback), handle);
    486494
     495    String firstPartyString = request.firstPartyForCookies().string();
     496    if (!firstPartyString.isEmpty()) {
     497        GOwnPtr<SoupURI> firstParty(soup_uri_new(firstPartyString.utf8().data()));
     498        soup_message_set_first_party(d->m_msg, firstParty.get());
     499    }
    487500    g_object_set_data(G_OBJECT(d->m_msg), "resourceHandle", reinterpret_cast<void*>(handle));
    488501
  • trunk/WebCore/platform/network/soup/ResourceRequestSoup.cpp

    r52308 r54352  
    2323#include "CString.h"
    2424#include "GOwnPtr.h"
     25#include "GOwnPtrGtk.h"
    2526#include "PlatformString.h"
    2627
     
    4344        for (HTTPHeaderMap::const_iterator it = headers.begin(); it != end; ++it)
    4445            soup_message_headers_append(soupHeaders, it->first.string().utf8().data(), it->second.utf8().data());
     46    }
     47
     48    String firstPartyString = firstPartyForCookies().string();
     49    if (!firstPartyString.isEmpty()) {
     50        GOwnPtr<SoupURI> firstParty(soup_uri_new(firstPartyString.utf8().data()));
     51        soup_message_set_first_party(soupMessage, firstParty.get());
    4552    }
    4653
     
    7077        m_httpBody = FormData::create(soupMessage->request_body->data, soupMessage->request_body->length);
    7178
    72     // FIXME: m_allowCookies and m_firstPartyForCookies should
    73     // probably be handled here and on doUpdatePlatformRequest
    74     // somehow.
     79    SoupURI* firstParty = soup_message_get_first_party(soupMessage);
     80    if (firstParty) {
     81        GOwnPtr<gchar> firstPartyURI(soup_uri_to_string(firstParty, FALSE));
     82        m_firstPartyForCookies = KURL(KURL(), String::fromUTF8(firstPartyURI.get()));
     83    }
     84
     85    // FIXME: m_allowCookies should probably be handled here and on
     86    // doUpdatePlatformRequest somehow.
    7587}
    7688
  • trunk/configure.ac

    r54260 r54352  
    191191
    192192# minimum base dependencies
    193 LIBSOUP_REQUIRED_VERSION=2.28.2
     193LIBSOUP_REQUIRED_VERSION=2.29.90
    194194CAIRO_REQUIRED_VERSION=1.6
    195195FONTCONFIG_REQUIRED_VERSION=2.4
Note: See TracChangeset for help on using the changeset viewer.