WebCore:
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 May 2009 18:56:14 +0000 (18:56 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 May 2009 18:56:14 +0000 (18:56 +0000)
2009-05-14  Brady Eidson  <beidson@apple.com>

        Reviewed by Darin Adler.

        <rdar://problem/6887762> and https://bugs.webkit.org/show_bug.cgi?id=25790

        Nuke the bogus ASSERT and add a legitimate ASSERT with a little help from a new accessor.

        * platform/network/ResourceHandle.cpp:
        (WebCore::ResourceHandle::shouldContentSniff):
        * platform/network/ResourceHandle.h:

        * platform/network/cf/ResourceHandleCFNet.cpp:
        (WebCore::createCFURLResponseWithDefaultMIMEType):
        (WebCore::didReceiveResponse):

LayoutTests:

2009-05-14  Brady Eidson  <beidson@apple.com>

        Reviewed by Darin Adler.

        <rdar://problem/6887762> and https://bugs.webkit.org/show_bug.cgi?id=25790

        * platform/win/Skipped: Renable these tests.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@43716 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/win/Skipped
WebCore/ChangeLog
WebCore/platform/network/ResourceHandle.cpp
WebCore/platform/network/ResourceHandle.h
WebCore/platform/network/cf/ResourceHandleCFNet.cpp

index d53cb82..6e883bf 100644 (file)
@@ -1,3 +1,11 @@
+2009-05-14  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/6887762> and https://bugs.webkit.org/show_bug.cgi?id=25790 
+
+        * platform/win/Skipped: Renable these tests.
+
 2009-05-14  Eric Carlson  <eric.carlson@apple.com>
 
         Reviewed by Darin Adler.
index d88d3b9..db0e9b4 100644 (file)
@@ -599,12 +599,6 @@ media/video-document-types.html
 svg/transforms/text-with-pattern-inside-transformed-html.xhtml
 svg/transforms/text-with-pattern-with-svg-transform.svg
 
-# Bug 25790: REGRESSION (r43518): Multiple XHR tests asserting in createCFURLResponseWithDefaultMIMEType on Windows <https://bugs.webkit.org/show_bug.cgi?id=25790>
-http/tests/xmlhttprequest/access-control-basic-denied-preflight-cache.html
-http/tests/xmlhttprequest/cache-override.html
-http/tests/xmlhttprequest/simple-cross-origin-denied-events-post.html
-http/tests/xmlhttprequest/xmlhttprequest-contenttype-empty.html
-
 # Bug 25792: fast/encoding/percent-escaping.html times out on Windows <https://bugs.webkit.org/show_bug.cgi?id=25792>
 fast/encoding/percent-escaping.html
 
index 7ad1b23..aa9ba03 100644 (file)
@@ -1,3 +1,19 @@
+2009-05-14  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/6887762> and https://bugs.webkit.org/show_bug.cgi?id=25790 
+
+        Nuke the bogus ASSERT and add a legitimate ASSERT with a little help from a new accessor.
+
+        * platform/network/ResourceHandle.cpp:
+        (WebCore::ResourceHandle::shouldContentSniff):
+        * platform/network/ResourceHandle.h:
+
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        (WebCore::createCFURLResponseWithDefaultMIMEType):
+        (WebCore::didReceiveResponse):
+
 2009-05-14  Eric Carlson  <eric.carlson@apple.com>
 
         Reviewed by Darin Adler.
index 0c64068..f339f55 100644 (file)
@@ -203,6 +203,11 @@ static bool portAllowed(const ResourceRequest& request)
     return false;
 }
   
+bool ResourceHandle::shouldContentSniff() const
+{
+    return d->m_shouldContentSniff;
+}
+
 bool ResourceHandle::shouldContentSniffURL(const KURL& url)
 {
     // We shouldn't content sniff file URLs as their MIME type should be established via their extension.
index 0530fb4..3f6b48a 100644 (file)
@@ -150,6 +150,7 @@ public:
     PassRefPtr<SharedBuffer> bufferedData();
     static bool supportsBufferedData();
 
+    bool shouldContentSniff() const;
     static bool shouldContentSniffURL(const KURL&);
     
 #if USE(WININET)
index 9baad92..c552ac7 100644 (file)
@@ -100,9 +100,6 @@ static HashMap<String, RetainPtr<CFDataRef> >& clientCerts()
 
 static CFURLResponseRef createCFURLResponseWithDefaultMIMEType(CFURLResponseRef response)
 {
-    // We should never be applying the default MIMEType if we told the networking layer to do content sniffing for this URL.
-    ASSERT(!ResourceHandle::shouldContentSniffURL(CFURLResponseGetURL(response)));
-    
     static CFStringRef defaultMIMETypeString = defaultMIMEType().createCFString();
     
     return CFURLResponseCreate(kCFAllocatorDefault, CFURLResponseGetURL(response), defaultMIMETypeString, 
@@ -141,6 +138,8 @@ void didReceiveResponse(CFURLConnectionRef conn, CFURLResponseRef cfResponse, co
     if (CFURLResponseGetMIMEType(cfResponse))
         handle->client()->didReceiveResponse(handle, cfResponse);
     else {
+        // We should never be applying the default MIMEType if we told the networking layer to do content sniffing for handle.
+        ASSERT(!handle->shouldContentSniff());
         RetainPtr<CFURLResponseRef> newResponse(AdoptCF, createCFURLResponseWithDefaultMIMEType(cfResponse));
         handle->client()->didReceiveResponse(handle, newResponse.get());
     }