Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 0cf62e1355dd217a7f023e0db54052785a718e21
- Author: Xan Lopez <xlopez@igalia.com>
- Date: Thu Feb 4 00:01:41 2010 +0200
- 2010-02-03 Xan Lopez <xlopez@igalia.com>
- Reviewed by NOBODY (OOPS!).
- Bump minimum libsoup requirement to 2.29.90
- * configure.ac:
- WebCore:
- 2010-02-03 Xan Lopez <xlopez@igalia.com>
- Reviewed by NOBODY (OOPS!).
- 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.
- * GNUmakefile.am:
- * platform/gtk/GOwnPtrGtk.cpp: Added.
- (WTF::SoupURI):
- (WTF::GstElement):
- * platform/gtk/GOwnPtrGtk.h: Added.
- * 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):
- diff --git a/ChangeLog b/ChangeLog
- index 5cc6c04..1987b5c 100644
- --- a/ChangeLog
- +++ b/ChangeLog
- @@ -1,3 +1,11 @@
- +2010-02-03 Xan Lopez <xlopez@igalia.com>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + Bump minimum libsoup requirement to 2.29.90
- +
- + * configure.ac:
- +
- 2010-02-02 Gustavo Noronha Silva <gns@gnome.org>
- Reviewed by Xan Lopez.
- diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
- index fbacc54..aed0a3e 100644
- --- a/WebCore/ChangeLog
- +++ b/WebCore/ChangeLog
- @@ -1,3 +1,26 @@
- +2010-02-03 Xan Lopez <xlopez@igalia.com>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + 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.
- +
- + * GNUmakefile.am:
- + * platform/gtk/GOwnPtrGtk.cpp: Added.
- + (WTF::SoupURI):
- + (WTF::GstElement):
- + * platform/gtk/GOwnPtrGtk.h: Added.
- + * 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):
- +
- 2010-02-03 Drew Wilson <atwilson@chromium.org>
- Reviewed by Alexey Proskuryakov.
- diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
- index 9f973da..973eba3 100644
- --- a/WebCore/GNUmakefile.am
- +++ b/WebCore/GNUmakefile.am
- @@ -2009,6 +2009,8 @@ webcoregtk_sources += \
- WebCore/platform/gtk/FileSystemGtk.cpp \
- WebCore/platform/gtk/GRefPtrGtk.cpp \
- WebCore/platform/gtk/GRefPtrGtk.h \
- + WebCore/platform/gtk/GOwnPtrGtk.cpp \
- + WebCore/platform/gtk/GOwnPtrGtk.h \
- WebCore/platform/gtk/GtkPluginWidget.cpp \
- WebCore/platform/gtk/GtkPluginWidget.h \
- WebCore/platform/gtk/KURLGtk.cpp \
- diff --git a/WebCore/platform/gtk/GOwnPtrGtk.cpp b/WebCore/platform/gtk/GOwnPtrGtk.cpp
- new file mode 100644
- index 0000000..3bb1335
- --- /dev/null
- +++ b/WebCore/platform/gtk/GOwnPtrGtk.cpp
- @@ -0,0 +1,40 @@
- +/*
- + * Copyright (C) 2010 Igalia S.L
- + *
- + * This library is free software; you can redistribute it and/or
- + * modify it under the terms of the GNU Lesser General Public
- + * License as published by the Free Software Foundation; either
- + * version 2 of the License, or (at your option) any later version.
- + *
- + * This library is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + * Lesser General Public License for more details.
- + *
- + * You should have received a copy of the GNU Lesser General Public
- + * License along with this library; if not, write to the Free Software
- + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- + */
- +
- +
- +#include "config.h"
- +#include "GOwnPtrGtk.h"
- +
- +#include <gst/gstelement.h>
- +#include <libsoup/soup-uri.h>
- +
- +namespace WTF {
- +
- +template <> void freeOwnedGPtr<SoupURI>(SoupURI* ptr)
- +{
- + if (ptr)
- + soup_uri_free(ptr);
- +}
- +
- +template <> void freeOwnedGPtr<GstElement>(GstElement* ptr)
- +{
- + if (ptr)
- + gst_object_unref(ptr);
- +}
- +
- +}
- diff --git a/WebCore/platform/gtk/GOwnPtrGtk.h b/WebCore/platform/gtk/GOwnPtrGtk.h
- new file mode 100644
- index 0000000..c585002
- --- /dev/null
- +++ b/WebCore/platform/gtk/GOwnPtrGtk.h
- @@ -0,0 +1,35 @@
- +/*
- + * Copyright (C) 2010 Igalia S.L
- + *
- + * This library is free software; you can redistribute it and/or
- + * modify it under the terms of the GNU Library General Public
- + * License as published by the Free Software Foundation; either
- + * version 2 of the License, or (at your option) any later version.
- + *
- + * This library is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + * Library General Public License for more details.
- + *
- + * You should have received a copy of the GNU Library General Public License
- + * along with this library; see the file COPYING.LIB. If not, write to
- + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- + * Boston, MA 02110-1301, USA.
- + */
- +
- +#ifndef GOwnPtrGtk_h
- +#define GOwnPtrGtk_h
- +
- +#include "GOwnPtr.h"
- +
- +typedef struct _SoupURI SoupURI;
- +typedef struct _GstElement GstElement;
- +
- +namespace WTF {
- +
- +template<> void freeOwnedGPtr<SoupURI>(SoupURI* ptr);
- +template<> void freeOwnedGPtr<GstElement>(GstElement* ptr);
- +
- +}
- +
- +#endif
- diff --git a/WebCore/platform/network/soup/CookieJarSoup.cpp b/WebCore/platform/network/soup/CookieJarSoup.cpp
- index 3eb578a..6f4cc2b 100644
- --- a/WebCore/platform/network/soup/CookieJarSoup.cpp
- +++ b/WebCore/platform/network/soup/CookieJarSoup.cpp
- @@ -24,6 +24,7 @@
- #include "Cookie.h"
- #include "CString.h"
- #include "Document.h"
- +#include "GOwnPtrGtk.h"
- #include "KURL.h"
- namespace WebCore {
- @@ -54,16 +55,19 @@ void setDefaultCookieJar(SoupCookieJar* jar)
- g_object_ref(cookieJar);
- }
- -void setCookies(Document* /*document*/, const KURL& url, const String& value)
- +void setCookies(Document* document, const KURL& url, const String& value)
- {
- SoupCookieJar* jar = defaultCookieJar();
- if (!jar)
- return;
- - SoupURI* origin = soup_uri_new(url.string().utf8().data());
- + GOwnPtr<SoupURI> origin(soup_uri_new(url.string().utf8().data()));
- + GOwnPtr<SoupURI> firstParty(soup_uri_new(document->firstPartyForCookies().string().utf8().data()));
- - soup_cookie_jar_set_cookie(jar, origin, value.utf8().data());
- - soup_uri_free(origin);
- + soup_cookie_jar_set_cookie_with_first_party(jar,
- + origin.get(),
- + firstParty.get(),
- + value.utf8().data());
- }
- String cookies(const Document* /*document*/, const KURL& url)
- diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
- index da16f4a..7862191 100644
- --- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
- +++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
- @@ -34,6 +34,7 @@
- #include "DocLoader.h"
- #include "FileSystem.h"
- #include "Frame.h"
- +#include "GOwnPtrGtk.h"
- #include "HTTPParsers.h"
- #include "Logging.h"
- #include "MIMETypeRegistry.h"
- @@ -209,6 +210,13 @@ static void restartedCallback(SoupMessage* msg, gpointer data)
- if (d->client())
- d->client()->willSendRequest(handle, request, response);
- +
- + // Update the first party in case the base URL changed with the redirect
- + String firstPartyString = request.firstPartyForCookies().string();
- + if (!firstPartyString.isEmpty()) {
- + GOwnPtr<SoupURI> firstParty(soup_uri_new(firstPartyString.utf8().data()));
- + soup_message_set_first_party(d->m_msg, firstParty.get());
- + }
- }
- static void gotHeadersCallback(SoupMessage* msg, gpointer data)
- @@ -484,6 +492,11 @@ static bool startHttp(ResourceHandle* handle)
- g_signal_connect(d->m_msg, "content-sniffed", G_CALLBACK(contentSniffedCallback), handle);
- g_signal_connect(d->m_msg, "got-chunk", G_CALLBACK(gotChunkCallback), handle);
- + String firstPartyString = request.firstPartyForCookies().string();
- + if (!firstPartyString.isEmpty()) {
- + GOwnPtr<SoupURI> firstParty(soup_uri_new(firstPartyString.utf8().data()));
- + soup_message_set_first_party(d->m_msg, firstParty.get());
- + }
- g_object_set_data(G_OBJECT(d->m_msg), "resourceHandle", reinterpret_cast<void*>(handle));
- FormData* httpBody = d->m_request.httpBody();
- diff --git a/WebCore/platform/network/soup/ResourceRequestSoup.cpp b/WebCore/platform/network/soup/ResourceRequestSoup.cpp
- index 0d4e0f9..bf289e3 100644
- --- a/WebCore/platform/network/soup/ResourceRequestSoup.cpp
- +++ b/WebCore/platform/network/soup/ResourceRequestSoup.cpp
- @@ -22,6 +22,7 @@
- #include "CString.h"
- #include "GOwnPtr.h"
- +#include "GOwnPtrGtk.h"
- #include "PlatformString.h"
- #include <libsoup/soup.h>
- @@ -44,6 +45,12 @@ SoupMessage* ResourceRequest::toSoupMessage() const
- soup_message_headers_append(soupHeaders, it->first.string().utf8().data(), it->second.utf8().data());
- }
- + String firstPartyString = firstPartyForCookies().string();
- + if (!firstPartyString.isEmpty()) {
- + GOwnPtr<SoupURI> firstParty(soup_uri_new(firstPartyString.utf8().data()));
- + soup_message_set_first_party(soupMessage, firstParty.get());
- + }
- +
- // Body data is only handled at ResourceHandleSoup::startHttp for
- // now; this is because this may not be a good place to go
- // openning and mmapping files. We should maybe revisit this.
- @@ -69,9 +76,14 @@ void ResourceRequest::updateFromSoupMessage(SoupMessage* soupMessage)
- if (soupMessage->request_body->data)
- m_httpBody = FormData::create(soupMessage->request_body->data, soupMessage->request_body->length);
- - // FIXME: m_allowCookies and m_firstPartyForCookies should
- - // probably be handled here and on doUpdatePlatformRequest
- - // somehow.
- + SoupURI* firstParty = soup_message_get_first_party(soupMessage);
- + if (firstParty) {
- + GOwnPtr<gchar> firstPartyURI(soup_uri_to_string(firstParty, FALSE));
- + m_firstPartyForCookies = KURL(KURL(), String::fromUTF8(firstPartyURI.get()));
- + }
- +
- + // FIXME: m_allowCookies should probably be handled here and on
- + // doUpdatePlatformRequest somehow.
- }
- unsigned initializeMaximumHTTPConnectionCountPerHost()
- diff --git a/configure.ac b/configure.ac
- index 082486b..56a3963 100644
- --- a/configure.ac
- +++ b/configure.ac
- @@ -190,7 +190,7 @@ if test "$with_hildon" = "yes"; then
- fi
- # minimum base dependencies
- -LIBSOUP_REQUIRED_VERSION=2.28.2
- +LIBSOUP_REQUIRED_VERSION=2.29.90
- CAIRO_REQUIRED_VERSION=1.6
- FONTCONFIG_REQUIRED_VERSION=2.4
- FREETYPE2_REQUIRED_VERSION=9.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement