[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 14:26:54 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e4bd1f1e82a812bea6800e5322097b2a8089d3dd
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 8 21:17:47 2010 +0000

    2010-10-08  Gavin Peters  <gavinp at chromium.org>
    
            Reviewed by Adam Barth.
    
            Output X-Purpose header for prefetch requests
            https://bugs.webkit.org/show_bug.cgi?id=46529
    
            * http/tests/misc/prefetch-purpose-expected.txt: Added.
            * http/tests/misc/prefetch-purpose.html: Added.
            * http/tests/misc/resources/prefetch-purpose.php: Added.
            * platform/gtk/Skipped:
            * platform/mac/Skipped:
            * platform/qt/Skipped:
            * platform/win/Skipped:
    2010-10-08  Gavin Peters  <gavinp at chromium.org>
    
            Reviewed by Adam Barth.
    
            Output X-Purpose header for prefetch requests
            https://bugs.webkit.org/show_bug.cgi?id=46529
    
            Test: http/tests/misc/prefetch-purpose.html
    
            * loader/loader.cpp:
            (WebCore::Loader::Host::servePendingRequests):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69420 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 71c6d43..8276b83 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-08  Gavin Peters  <gavinp at chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Output X-Purpose header for prefetch requests
+        https://bugs.webkit.org/show_bug.cgi?id=46529
+
+        * http/tests/misc/prefetch-purpose-expected.txt: Added.
+        * http/tests/misc/prefetch-purpose.html: Added.
+        * http/tests/misc/resources/prefetch-purpose.php: Added.
+        * platform/gtk/Skipped:
+        * platform/mac/Skipped:
+        * platform/qt/Skipped:
+        * platform/win/Skipped:
+
 2010-10-08  Albert J. Wong  <ajwong at chromium.org>
 
         [chromium] Unreviewed. Build fix.
diff --git a/LayoutTests/http/tests/misc/prefetch-purpose-expected.txt b/LayoutTests/http/tests/misc/prefetch-purpose-expected.txt
new file mode 100644
index 0000000..68486ea
--- /dev/null
+++ b/LayoutTests/http/tests/misc/prefetch-purpose-expected.txt
@@ -0,0 +1,7 @@
+prefetch-purpose.php has MIME type text/html
+prefetch-purpose.php has MIME type text/html
+The cookie was set!
+
+X-Purpose: prefetch
+
+This test verifies that prefetches are sent with the HTTP request header X-Purpose: prefetch. To do this, the root page has a prefetch link targetting this subresource which contains a PHP script (resources/prefetch-purpose.php). That initial prefetch of this resource sets a cookie. Later, the root page sets window.location to target this script, which verifies the presence of the cookie, and generates the happy test output that you hopefully see right now.
diff --git a/LayoutTests/http/tests/misc/prefetch-purpose.html b/LayoutTests/http/tests/misc/prefetch-purpose.html
new file mode 100644
index 0000000..12f17e1
--- /dev/null
+++ b/LayoutTests/http/tests/misc/prefetch-purpose.html
@@ -0,0 +1,20 @@
+<html>
+<head>
+<script>
+
+function finishUp() {
+    window.location = 'resources/prefetch-purpose.php';
+}
+
+if (window.layoutTestController) {
+    layoutTestController.waitUntilDone();
+    layoutTestController.dumpAsText();
+    layoutTestController.dumpResourceResponseMIMETypes();
+}
+</script>
+<link href="resources/prefetch-purpose.php" rel="prefetch">
+</head>
+<body onload="setTimeout('finishUp()', 50);">
+<p>Nothing to see here, this page should replace itself with resources/prefetch-purpose.php almost instantly.
+</body>
+</html>
diff --git a/LayoutTests/http/tests/misc/resources/prefetch-purpose.php b/LayoutTests/http/tests/misc/resources/prefetch-purpose.php
new file mode 100644
index 0000000..9693eb9
--- /dev/null
+++ b/LayoutTests/http/tests/misc/resources/prefetch-purpose.php
@@ -0,0 +1,24 @@
+<?php setcookie("X-Purpose", $_SERVER["HTTP_X_PURPOSE"]);
+
+if (isset($_COOKIE['X-Purpose'])) {
+    setcookie("X-Purpose", "", time() - 3600);
+    echo "<h1>The cookie was set!</h1>";
+    echo "<p>X-Purpose: ";
+    echo $_COOKIE['X-Purpose'];
+} else {
+    echo "<h1>BAD BROWSER NO COOKIE</h1>";
+}
+?>
+
+<script>
+layoutTestController.notifyDone();
+</script>
+
+<p>This test verifies that prefetches are sent with the HTTP request header
+<b>X-Purpose: prefetch</b>.  To do this, the root page has a prefetch
+link targetting this subresource which contains a PHP script
+(resources/prefetch-purpose.php).  That initial prefetch of this
+resource sets a cookie.  Later, the root page sets window.location to
+target this script, which verifies the presence of the cookie, and
+generates the happy test output that you hopefully see right now.
+
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 2a5706b..ff881f6 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -3049,6 +3049,7 @@ http/tests/mime/standard-mode-loads-stylesheet-with-text-css-and-invalid-type.ht
 http/tests/misc/acid3.html
 http/tests/misc/isindex-formdata.html
 http/tests/misc/policy-delegate-called-twice.html
+http/tests/misc/prefetch-purpose.html
 http/tests/misc/redirect-to-external-url.html
 http/tests/misc/slow-preload-cancel.html
 http/tests/misc/window-dot-stop.html
diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index ab039b8..4c3619f 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -233,6 +233,7 @@ fast/dom/Window/window-properties-device-orientation.html
 
 # Link prefetch is disabled by default
 fast/dom/HTMLLinkElement/prefetch.html
+http/tests/misc/prefetch-purpose.html
 
 # https://bugs.webkit.org/show_bug.cgi?id=39908
 fast/dom/Geolocation/maximum-age.html
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index 83f0f21..1442740 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -5301,6 +5301,7 @@ fast/dom/Geolocation/callback-to-remote-context2.html
 
 # Link prefetch is disabled by default
 fast/dom/HTMLLinkElement/prefetch.html
+http/tests/misc/prefetch-purpose.html
 
 # [Qt] Regression(r61749): inspector/debugger-pause-on-debugger-statement.html fails
 # https://bugs.webkit.org/show_bug.cgi?id=41147
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 6da31e3..32933bf 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -916,6 +916,7 @@ fast/dom/Window/window-properties-device-orientation.html
 
 # Link prefetch is disabled by default
 fast/dom/HTMLLinkElement/prefetch.html
+http/tests/misc/prefetch-purpose.html
 
 # LayoutTestController::pageProperty is not implemented for WIN yet.
 printing/page-rule-selection.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6adae22..a9ce425 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-08  Gavin Peters  <gavinp at chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Output X-Purpose header for prefetch requests
+        https://bugs.webkit.org/show_bug.cgi?id=46529
+
+        Test: http/tests/misc/prefetch-purpose.html
+
+        * loader/loader.cpp:
+        (WebCore::Loader::Host::servePendingRequests):
+
 2010-10-08  James Kozianski  <koz at chromium.org>
 
         Reviewed by Simon Fraser.
diff --git a/WebCore/loader/loader.cpp b/WebCore/loader/loader.cpp
index 8f262e2..2c8f3bd 100644
--- a/WebCore/loader/loader.cpp
+++ b/WebCore/loader/loader.cpp
@@ -358,6 +358,11 @@ void Loader::Host::servePendingRequests(RequestQueue& requestsPending, bool& ser
             }
         }
 
+#if ENABLE(LINK_PREFETCH)
+        if (request->cachedResource()->type() == CachedResource::LinkPrefetch)
+            resourceRequest.setHTTPHeaderField("X-Purpose", "prefetch");
+#endif
+
         RefPtr<SubresourceLoader> loader = SubresourceLoader::create(cachedResourceLoader->doc()->frame(),
             this, resourceRequest, request->shouldDoSecurityCheck(), request->sendResourceLoadCallbacks());
         if (loader) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list