[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

japhet at chromium.org japhet at chromium.org
Fri Jan 21 15:08:14 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit a539e08b9d55339cf77706c800aab16bcca3d979
Author: japhet at chromium.org <japhet at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 7 19:46:17 2011 +0000

    2011-01-07  Nate Chapin  <japhet at chromium.org>
    
            Reviewed by Darin Fisher.
    
            Let PingLoader send cookies if FrameLoaderClient permits it.
            https://bugs.webkit.org/show_bug.cgi?id=51898
    
            Test: http/tests/navigation/ping-cookie.html
    
            * loader/PingLoader.cpp:
            (WebCore::PingLoader::PingLoader): Set m_shouldUseCredentialStorage
                at load start time, since we won't be able to call
                FrameLoaderClient::shouldUseCredentialStorage() later.
            * loader/PingLoader.h:
            (WebCore::PingLoader::shouldUseCredentialStorage):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75261 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index dcee758..c0e4809 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2011-01-07  Nate Chapin  <japhet at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Test for https://bugs.webkit.org/show_bug.cgi?id=51898.
+
+        * http/tests/navigation/ping-cookie-expected.txt: Added.
+        * http/tests/navigation/ping-cookie.html: Added.
+        * http/tests/navigation/resources/save-ping.php:
+
 2011-01-07  Xan Lopez  <xlopez at igalia.com>
 
         Unreviewed, rolling out r75256.
diff --git a/LayoutTests/http/tests/navigation/ping-cookie-expected.txt b/LayoutTests/http/tests/navigation/ping-cookie-expected.txt
new file mode 100644
index 0000000..e69269c
--- /dev/null
+++ b/LayoutTests/http/tests/navigation/ping-cookie-expected.txt
@@ -0,0 +1,6 @@
+Ping sent successfully
+CONTENT_TYPE: text/ping
+HTTP_COOKIE: hello=world
+HTTP_PING_FROM: http://127.0.0.1:8000/navigation/ping-cookie.html
+HTTP_PING_TO: http://127.0.0.1:8000/navigation/resources/check-ping.php
+REQUEST_METHOD: POST
diff --git a/LayoutTests/http/tests/navigation/ping-cookie.html b/LayoutTests/http/tests/navigation/ping-cookie.html
new file mode 100644
index 0000000..4e789c7
--- /dev/null
+++ b/LayoutTests/http/tests/navigation/ping-cookie.html
@@ -0,0 +1,46 @@
+<html><head>
+<title>Ping</title>
+<script>
+
+var testCalled = false;
+
+function test() {
+    if (!testCalled) {
+        if (window.layoutTestController) {
+            layoutTestController.dumpAsText();
+            layoutTestController.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+            layoutTestController.waitUntilDone();
+        }
+        testCalled = true;
+        return;
+    }
+    try {
+        var xhr = new XMLHttpRequest();
+        xhr.open("GET", "../cookies/resources/setCookies.cgi", false);
+        xhr.setRequestHeader("SET_COOKIE", "hello=world;path=/");
+        xhr.send(null);
+        if (xhr.status != 200) {
+            document.getElementsByTagName("body")[0].appendChild(document.createTextNode("FAILED: cookie not set"));
+            if (window.layoutTestController)
+                layoutTestController.notifyDone();
+        }
+    } catch (e) {
+        document.getElementsByTagName("body")[0].appendChild(document.createTextNode("FAILED: cookie not set"));
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+
+    if (window.eventSender) {
+        var a = document.getElementById("a");
+        eventSender.mouseMoveTo(a.offsetLeft + 2, a.offsetTop + 2);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+}
+
+</script>
+</head>
+<body onload="test();">
+<img src="resources/delete-ping.php" onload="test();" onerror="test();"></img>
+<a id="a" href="resources/check-ping.php" ping="resources/save-ping.php">Navigate and send ping</a>
+</body></html>
diff --git a/LayoutTests/http/tests/navigation/resources/save-ping.php b/LayoutTests/http/tests/navigation/resources/save-ping.php
index 4d08278..0e9c2fb 100644
--- a/LayoutTests/http/tests/navigation/resources/save-ping.php
+++ b/LayoutTests/http/tests/navigation/resources/save-ping.php
@@ -3,9 +3,11 @@ $pingFile = fopen("ping.txt.tmp", 'w');
 $httpHeaders = $_SERVER;
 ksort($httpHeaders, SORT_STRING);
 foreach ($httpHeaders as $name => $value) {
-    if ($name === "CONTENT_TYPE" || $name === "HTTP_REFERER" || $name === "HTTP_PING_TO" || $name === "HTTP_PING_FROM" || $name === "REQUEST_METHOD")
+    if ($name === "CONTENT_TYPE" || $name === "HTTP_REFERER" || $name === "HTTP_PING_TO" || $name === "HTTP_PING_FROM" || $name === "REQUEST_METHOD" || $name === "HTTP_COOKIE")
         fwrite($pingFile, "$name: $value\n");
 }
 fclose($pingFile);
 rename("ping.txt.tmp", "ping.txt");
+foreach ($_COOKIE as $name => $value)
+    setcookie($name, "deleted", time() - 60, "/");
 ?>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 30a8e26..ce417b4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2011-01-07  Nate Chapin  <japhet at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Let PingLoader send cookies if FrameLoaderClient permits it.
+        https://bugs.webkit.org/show_bug.cgi?id=51898
+
+        Test: http/tests/navigation/ping-cookie.html
+
+        * loader/PingLoader.cpp:
+        (WebCore::PingLoader::PingLoader): Set m_shouldUseCredentialStorage
+            at load start time, since we won't be able to call 
+            FrameLoaderClient::shouldUseCredentialStorage() later.
+        * loader/PingLoader.h:
+        (WebCore::PingLoader::shouldUseCredentialStorage):
+
 2011-01-07  Xan Lopez  <xlopez at igalia.com>
 
         Unreviewed, rolling out r75256.
diff --git a/WebCore/loader/PingLoader.cpp b/WebCore/loader/PingLoader.cpp
index d687b42..280620a 100644
--- a/WebCore/loader/PingLoader.cpp
+++ b/WebCore/loader/PingLoader.cpp
@@ -34,6 +34,9 @@
 
 #include "FormData.h"
 #include "Frame.h"
+#include "FrameLoaderClient.h"
+#include "Page.h"
+#include "ProgressTracker.h"
 #include "ResourceHandle.h"
 #include "SecurityOrigin.h"
 #include <wtf/OwnPtr.h>
@@ -91,6 +94,8 @@ void PingLoader::sendPing(Frame* frame, const KURL& pingURL, const KURL& destina
 PingLoader::PingLoader(Frame* frame, const ResourceRequest& request)
     : m_timeout(this, &PingLoader::timeout)
 {
+    unsigned long identifier = frame->page()->progress()->createUniqueIdentifier();
+    m_shouldUseCredentialStorage = frame->loader()->client()->shouldUseCredentialStorage(frame->loader()->activeDocumentLoader(), identifier);
     m_handle = ResourceHandle::create(frame->loader()->networkingContext(), request, this, false, false);
 
     // If the server never responds, FrameLoader won't be able to cancel this load and
diff --git a/WebCore/loader/PingLoader.h b/WebCore/loader/PingLoader.h
index eb43166..3a076fb 100644
--- a/WebCore/loader/PingLoader.h
+++ b/WebCore/loader/PingLoader.h
@@ -65,9 +65,11 @@ private:
     void didFinishLoading(ResourceHandle*, double) { delete this; }
     void didFail(ResourceHandle*, const ResourceError&) { delete this; }
     void timeout(Timer<PingLoader>*) { delete this; }
+    bool shouldUseCredentialStorage(ResourceHandle*) { return m_shouldUseCredentialStorage; }
 
     RefPtr<ResourceHandle> m_handle;
     Timer<PingLoader> m_timeout;
+    bool m_shouldUseCredentialStorage;
 };
 
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list