WebCore:

        Reviewed by Darin.

        <rdar://problem/5298296> XMLHttpRequest readyState 3 & responseText buffer issues
        
        Add a shouldContentSniff flag to ResourceLoader and ResourceHandle and have XMLHttpRequest 
        pass in false when creating its subresource loader.
        
        * WebCore.exp:
        * loader/MainResourceLoader.cpp:
        (WebCore::MainResourceLoader::MainResourceLoader):
        (WebCore::MainResourceLoader::loadNow):
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::ResourceLoader):
        (WebCore::ResourceLoader::load):
        * loader/ResourceLoader.h:
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::SubresourceLoader):
        (WebCore::SubresourceLoader::create):
        * loader/SubresourceLoader.h:
        * loader/mac/NetscapePlugInStreamLoaderMac.mm:
        (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
        * platform/network/ResourceHandle.cpp:
        (WebCore::ResourceHandle::ResourceHandle):
        (WebCore::ResourceHandle::create):
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleInternal.h:
        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::start):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::send):

WebKit:

        Reviewed by Darin.

        <rdar://problem/5298296> XMLHttpRequest readyState 3 & responseText buffer issues
        
        Expose WKSetNSURLRequestShouldContentSniff to WebCore.
        
        * WebCoreSupport/WebSystemInterface.m:
        (InitWebCoreSystemInterface):

LayoutTests:

        Reviewed by Darin.

        <rdar://problem/5298296> XMLHttpRequest readyState 3 & responseText buffer issues
        
        * http/tests/xmlhttprequest/resources/small-chunks.cgi: Added.
        * http/tests/xmlhttprequest/small-chunks-response-text-expected.txt: Added.
        * http/tests/xmlhttprequest/small-chunks-response-text.html: Added.
        * platform/mac-leopard/Skipped:
        * platform/mac-tiger/Skipped:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp
index 3a69d06..8efc3d1 100644
--- a/WebCore/loader/MainResourceLoader.cpp
+++ b/WebCore/loader/MainResourceLoader.cpp
@@ -42,7 +42,7 @@
 namespace WebCore {
 
 MainResourceLoader::MainResourceLoader(Frame* frame)
-    : ResourceLoader(frame, true)
+    : ResourceLoader(frame, true, true)
     , m_dataLoadTimer(this, &MainResourceLoader::handleDataLoadNow)
     , m_loadingMultipartContent(false)
     , m_waitingForContentPolicy(false)
@@ -374,7 +374,7 @@
     else if (shouldLoadEmpty || frameLoader()->representationExistsForURLScheme(url.protocol()))
         handleEmptyLoad(url, !shouldLoadEmpty);
     else
-        m_handle = ResourceHandle::create(r, this, m_frame.get(), false, true);
+        m_handle = ResourceHandle::create(r, this, m_frame.get(), false, true, true);
 
     return false;
 }