[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

sergio at webkit.org sergio at webkit.org
Sun Feb 20 23:07:21 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 55c7f491603d7c24595069174ad47dd6dc972d90
Author: sergio at webkit.org <sergio at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 17 20:47:08 2011 +0000

    2011-01-17  Sergio Villar Senin  <svillar at igalia.com>
    
            Reviewed by Martin Robinson.
    
            [Gtk] No need to content sniff 304 Not Modified responses
            https://bugs.webkit.org/show_bug.cgi?id=52570
    
            Makes no sense to wait for the outcome of content sniffing when WebCore
            is validating resources. If we get a 304 Not Modified it means that we can
            safely use the cached version of the resource we're asking for.
    
            No new tests because it does not change functionality, it just
            calls didReceiveResponse sooner for 304 Not Modified responses.
    
            * platform/network/soup/ResourceHandleSoup.cpp:
            (WebCore::gotHeadersCallback):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75967 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index c1176ca..8508257 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2011-01-17  Sergio Villar Senin  <svillar at igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [Gtk] No need to content sniff 304 Not Modified responses
+        https://bugs.webkit.org/show_bug.cgi?id=52570
+
+        Makes no sense to wait for the outcome of content sniffing when WebCore
+        is validating resources. If we get a 304 Not Modified it means that we can
+        safely use the cached version of the resource we're asking for.
+
+        No new tests because it does not change functionality, it just
+        calls didReceiveResponse sooner for 304 Not Modified responses.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::gotHeadersCallback):
+
 2011-01-17  Jessie Berlin  <jberlin at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index 8900b18..ebb6c5f 100644
--- a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -215,6 +215,8 @@ static void restartedCallback(SoupMessage* msg, gpointer data)
 #endif
 }
 
+static void contentSniffedCallback(SoupMessage*, const char*, GHashTable*, gpointer);
+
 static void gotHeadersCallback(SoupMessage* msg, gpointer data)
 {
     // For 401, we will accumulate the resource body, and only use it
@@ -235,9 +237,18 @@ static void gotHeadersCallback(SoupMessage* msg, gpointer data)
 
     // The content-sniffed callback will handle the response if WebCore
     // require us to sniff.
-    if (!handle || statusWillBeHandledBySoup(msg->status_code) || handle->shouldContentSniff())
+    if (!handle || statusWillBeHandledBySoup(msg->status_code))
         return;
 
+    if (handle->shouldContentSniff()) {
+        // Avoid MIME type sniffing if the response comes back as 304 Not Modified.
+        if (msg->status_code == SOUP_STATUS_NOT_MODIFIED) {
+            soup_message_disable_feature(msg, SOUP_TYPE_CONTENT_SNIFFER);
+            g_signal_handlers_disconnect_by_func(msg, reinterpret_cast<gpointer>(contentSniffedCallback), handle.get());
+        } else
+            return;
+    }
+
     ResourceHandleInternal* d = handle->getInternal();
     if (d->m_cancelled)
         return;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list