[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

xan at webkit.org xan at webkit.org
Wed Feb 10 22:14:18 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 4604dddd658904e811034b46f851c996ea79c027
Author: xan at webkit.org <xan at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 4 18:09:15 2010 +0000

    2010-02-04  Xan Lopez  <xlopez at igalia.com>
    
            Reviewed by Gustavo Noronha.
    
            Bump minimum libsoup requirement to 2.29.90
    
            * configure.ac:
    
    WebCore:
    
    2010-02-04  Xan Lopez  <xlopez at 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):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54352 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/ChangeLog b/ChangeLog
index 5cc6c04..23995e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-02-04  Xan Lopez  <xlopez at igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Bump minimum libsoup requirement to 2.29.90
+
+        * configure.ac:
+
 2010-02-02  Gustavo Noronha Silva  <gns at gnome.org>
 
         Reviewed by Xan Lopez.
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e6eb5fe..c12036d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-02-04  Xan Lopez  <xlopez at 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):
+
 2010-02-04  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
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

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list