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

abarth at webkit.org abarth at webkit.org
Wed Dec 22 13:10:44 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 17d66c6d85ccbd70375e7f34aba5424bd4ab6be7
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 8 10:26:02 2010 +0000

    2010-09-08  Adam Barth  <abarth at webkit.org>
    
            Rubber-stamped by Eric Seidel.
    
            Rename DocLoader to CachedResourceLoader because that's what it does.
    
            * WebDataSource.cpp:
    2010-09-08  Adam Barth  <abarth at webkit.org>
    
            Rubber-stamped by Eric Seidel.
    
            Rename DocLoader to CachedResourceLoader because that's what it does.
    
            * WebView/WebFrame.mm:
    2010-09-08  Adam Barth  <abarth at webkit.org>
    
            Rubber-stamped by Eric Seidel.
    
            Rename DocLoader to CachedResourceLoader because that's what it does.
    
            * Android.mk:
            * CMakeLists.txt:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * css/CSSCursorImageValue.cpp:
            (WebCore::CSSCursorImageValue::cachedImage):
            * css/CSSCursorImageValue.h:
            * css/CSSFontFaceSource.cpp:
            (WebCore::CSSFontFaceSource::getFontData):
            * css/CSSFontSelector.cpp:
            (WebCore::CSSFontSelector::cachedResourceLoader):
            (WebCore::CSSFontSelector::addFontFaceRule):
            * css/CSSFontSelector.h:
            * css/CSSImageValue.cpp:
            (WebCore::CSSImageValue::cachedImage):
            * css/CSSImageValue.h:
            * css/CSSImportRule.cpp:
            (WebCore::CSSImportRule::insertedIntoParent):
            * css/CSSStyleSelector.cpp:
            (WebCore::CSSStyleSelector::loadPendingImages):
            * css/CSSStyleSheet.h:
            * dom/Document.cpp:
            (WebCore::Document::Document):
            (WebCore::Document::~Document):
            (WebCore::Document::implicitClose):
            * dom/Document.h:
            (WebCore::Document::cachedResourceLoader):
            * dom/ProcessingInstruction.cpp:
            (WebCore::ProcessingInstruction::checkStyleSheet):
            * dom/ScriptElement.cpp:
            (WebCore::ScriptElementData::requestScript):
            * dom/XMLDocumentParser.cpp:
            * dom/XMLDocumentParser.h:
            * dom/XMLDocumentParserLibxml2.cpp:
            (WebCore::matchFunc):
            (WebCore::shouldAllowExternalLoad):
            (WebCore::openFunc):
            (WebCore::XMLDocumentParser::doWrite):
            (WebCore::XMLDocumentParser::endElementNs):
            (WebCore::XMLDocumentParser::initializeParserContext):
            (WebCore::XMLDocumentParser::doEnd):
            (WebCore::xmlDocPtrForString):
            * dom/XMLDocumentParserQt.cpp:
            (WebCore::XMLDocumentParser::parseEndElement):
            * dom/XMLDocumentParserScope.cpp:
            (WebCore::XMLDocumentParserScope::XMLDocumentParserScope):
            (WebCore::XMLDocumentParserScope::~XMLDocumentParserScope):
            * dom/XMLDocumentParserScope.h:
            * editing/Editor.cpp:
            (WebCore::Editor::paste):
            * editing/mac/EditorMac.mm:
            (WebCore::Editor::paste):
            * html/HTMLLinkElement.cpp:
            (WebCore::HTMLLinkElement::process):
            * html/parser/CSSPreloadScanner.cpp:
            (WebCore::CSSPreloadScanner::emitRule):
            * html/parser/HTMLPreloadScanner.cpp:
            (WebCore::HTMLNames::PreloadTask::preload):
            * html/parser/HTMLScriptRunner.cpp:
            (WebCore::HTMLScriptRunner::requestPendingScript):
            * inspector/InspectorResource.cpp:
            (WebCore::InspectorResource::cachedResource):
            * loader/Cache.cpp:
            (WebCore::Cache::requestResource):
            (WebCore::Cache::requestUserCSSStyleSheet):
            (WebCore::Cache::revalidateResource):
            (WebCore::Cache::addCachedResourceLoader):
            (WebCore::Cache::removeCachedResourceLoader):
            * loader/Cache.h:
            * loader/CachedCSSStyleSheet.h:
            * loader/CachedFont.cpp:
            (WebCore::CachedFont::load):
            (WebCore::CachedFont::beginLoadIfNeeded):
            * loader/CachedFont.h:
            * loader/CachedImage.cpp:
            (WebCore::CachedImage::load):
            (WebCore::CachedImage::maximumDecodedImageSize):
            * loader/CachedImage.h:
            * loader/CachedResource.cpp:
            (WebCore::CachedResource::CachedResource):
            (WebCore::CachedResource::~CachedResource):
            (WebCore::CachedResource::load):
            * loader/CachedResource.h:
            (WebCore::CachedResource::load):
            (WebCore::CachedResource::setCachedResourceLoader):
            * loader/CachedResourceLoader.cpp: Copied from WebCore/loader/DocLoader.cpp.
            (WebCore::CachedResourceLoader::CachedResourceLoader):
            (WebCore::CachedResourceLoader::~CachedResourceLoader):
            (WebCore::CachedResourceLoader::frame):
            (WebCore::CachedResourceLoader::checkForReload):
            (WebCore::CachedResourceLoader::requestImage):
            (WebCore::CachedResourceLoader::requestFont):
            (WebCore::CachedResourceLoader::requestCSSStyleSheet):
            (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
            (WebCore::CachedResourceLoader::requestScript):
            (WebCore::CachedResourceLoader::requestXSLStyleSheet):
            (WebCore::CachedResourceLoader::requestLinkPrefetch):
            (WebCore::CachedResourceLoader::canRequest):
            (WebCore::CachedResourceLoader::requestResource):
            (WebCore::CachedResourceLoader::printAccessDeniedMessage):
            (WebCore::CachedResourceLoader::setAutoLoadImages):
            (WebCore::CachedResourceLoader::cachePolicy):
            (WebCore::CachedResourceLoader::removeCachedResource):
            (WebCore::CachedResourceLoader::setLoadInProgress):
            (WebCore::CachedResourceLoader::checkCacheObjectStatus):
            (WebCore::CachedResourceLoader::incrementRequestCount):
            (WebCore::CachedResourceLoader::decrementRequestCount):
            (WebCore::CachedResourceLoader::requestCount):
            (WebCore::CachedResourceLoader::preload):
            (WebCore::CachedResourceLoader::checkForPendingPreloads):
            (WebCore::CachedResourceLoader::requestPreload):
            (WebCore::CachedResourceLoader::clearPreloads):
            (WebCore::CachedResourceLoader::clearPendingPreloads):
            (WebCore::CachedResourceLoader::printPreloadStats):
            * loader/CachedResourceLoader.h: Copied from WebCore/loader/DocLoader.h.
            * loader/CachedScript.h:
            * loader/CachedXSLStyleSheet.h:
            * loader/DocLoader.cpp: Removed.
            * loader/DocLoader.h: Removed.
            * loader/DocumentLoader.cpp:
            (WebCore::DocumentLoader::isLoadingInAPISense):
            (WebCore::DocumentLoader::subresource):
            (WebCore::DocumentLoader::getSubresources):
            * loader/FrameLoader.cpp:
            (WebCore::numRequests):
            (WebCore::FrameLoader::stopLoading):
            (WebCore::FrameLoader::didBeginDocument):
            * loader/HistoryController.cpp:
            (WebCore::HistoryController::createItem):
            * loader/ImageLoader.cpp:
            (WebCore::ImageLoader::updateFromElement):
            * loader/Request.cpp:
            (WebCore::Request::Request):
            * loader/Request.h:
            (WebCore::Request::cachedResourceLoader):
            * loader/loader.cpp:
            (WebCore::Loader::load):
            (WebCore::Loader::cancelRequests):
            (WebCore::Loader::Host::servePendingRequests):
            (WebCore::Loader::Host::didFinishLoading):
            (WebCore::Loader::Host::didFail):
            (WebCore::Loader::Host::didReceiveResponse):
            (WebCore::Loader::Host::cancelPendingRequests):
            (WebCore::Loader::Host::cancelRequests):
            * loader/loader.h:
            * page/DragController.cpp:
            (WebCore::DragController::concludeEditDrag):
            * page/Frame.cpp:
            * page/FrameView.cpp:
            (WebCore::FrameView::checkStopDelayingDeferredRepaints):
            (WebCore::FrameView::updateDeferredRepaintDelay):
            * page/Settings.cpp:
            (WebCore::setLoadsImagesAutomaticallyInAllFrames):
            * platform/android/TemporaryLinkStubs.cpp:
            (WebCore::CheckCacheObjectStatus):
            * platform/network/android/ResourceHandleAndroid.cpp:
            (WebCore::ResourceHandle::start):
            * platform/network/cf/ResourceHandleCFNet.cpp:
            * platform/network/curl/ResourceHandleCurl.cpp:
            * platform/network/mac/ResourceHandleMac.mm:
            * platform/network/qt/ResourceHandleQt.cpp:
            * platform/network/soup/ResourceHandleSoup.cpp:
            * platform/network/win/ResourceHandleWin.cpp:
            * svg/SVGFEImageElement.cpp:
            (WebCore::SVGFEImageElement::requestImageResource):
            * svg/SVGFontFaceUriElement.cpp:
            (WebCore::SVGFontFaceUriElement::loadFont):
            * workers/Worker.cpp:
            * xml/XSLImportRule.cpp:
            (WebCore::XSLImportRule::loadSheet):
            * xml/XSLStyleSheet.h:
            * xml/XSLStyleSheetLibxslt.cpp:
            (WebCore::XSLStyleSheet::cachedResourceLoader):
            (WebCore::XSLStyleSheet::parseString):
            * xml/XSLStyleSheetQt.cpp:
            (WebCore::XSLStyleSheet::cachedResourceLoader):
            * xml/XSLTProcessor.cpp:
            * xml/XSLTProcessorLibxslt.cpp:
            (WebCore::docLoaderFunc):
            (WebCore::setXSLTLoadCallBack):
            (WebCore::xmlDocPtrFromNode):
            (WebCore::XSLTProcessor::transformToString):
    2010-09-08  Adam Barth  <abarth at webkit.org>
    
            Rubber-stamped by Eric Seidel.
    
            Rename DocLoader to CachedResourceLoader because that's what it does.
    
            * Scripts/do-webcore-rename:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66963 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index f53daba..8193746 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -315,7 +315,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
 	loader/CachedScript.cpp \
 	loader/CrossOriginAccessControl.cpp \
 	loader/CrossOriginPreflightResultCache.cpp \
-	loader/DocLoader.cpp \
+	loader/CachedResourceLoader.cpp \
 	loader/DocumentLoader.cpp \
 	loader/DocumentThreadableLoader.cpp \
 	loader/DocumentWriter.cpp \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 291c780..885d801 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -1083,7 +1083,7 @@ SET(WebCore_SOURCES
     loader/CachedXSLStyleSheet.cpp
     loader/CrossOriginAccessControl.cpp
     loader/CrossOriginPreflightResultCache.cpp
-    loader/DocLoader.cpp
+    loader/CachedResourceLoader.cpp
     loader/DocumentLoader.cpp
     loader/DocumentThreadableLoader.cpp
     loader/DocumentWriter.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0368246..b60d732 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,195 @@
+2010-09-08  Adam Barth  <abarth at webkit.org>
+
+        Rubber-stamped by Eric Seidel.
+
+        Rename DocLoader to CachedResourceLoader because that's what it does.
+
+        * Android.mk:
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSCursorImageValue.cpp:
+        (WebCore::CSSCursorImageValue::cachedImage):
+        * css/CSSCursorImageValue.h:
+        * css/CSSFontFaceSource.cpp:
+        (WebCore::CSSFontFaceSource::getFontData):
+        * css/CSSFontSelector.cpp:
+        (WebCore::CSSFontSelector::cachedResourceLoader):
+        (WebCore::CSSFontSelector::addFontFaceRule):
+        * css/CSSFontSelector.h:
+        * css/CSSImageValue.cpp:
+        (WebCore::CSSImageValue::cachedImage):
+        * css/CSSImageValue.h:
+        * css/CSSImportRule.cpp:
+        (WebCore::CSSImportRule::insertedIntoParent):
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::loadPendingImages):
+        * css/CSSStyleSheet.h:
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::~Document):
+        (WebCore::Document::implicitClose):
+        * dom/Document.h:
+        (WebCore::Document::cachedResourceLoader):
+        * dom/ProcessingInstruction.cpp:
+        (WebCore::ProcessingInstruction::checkStyleSheet):
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElementData::requestScript):
+        * dom/XMLDocumentParser.cpp:
+        * dom/XMLDocumentParser.h:
+        * dom/XMLDocumentParserLibxml2.cpp:
+        (WebCore::matchFunc):
+        (WebCore::shouldAllowExternalLoad):
+        (WebCore::openFunc):
+        (WebCore::XMLDocumentParser::doWrite):
+        (WebCore::XMLDocumentParser::endElementNs):
+        (WebCore::XMLDocumentParser::initializeParserContext):
+        (WebCore::XMLDocumentParser::doEnd):
+        (WebCore::xmlDocPtrForString):
+        * dom/XMLDocumentParserQt.cpp:
+        (WebCore::XMLDocumentParser::parseEndElement):
+        * dom/XMLDocumentParserScope.cpp:
+        (WebCore::XMLDocumentParserScope::XMLDocumentParserScope):
+        (WebCore::XMLDocumentParserScope::~XMLDocumentParserScope):
+        * dom/XMLDocumentParserScope.h:
+        * editing/Editor.cpp:
+        (WebCore::Editor::paste):
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::paste):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::process):
+        * html/parser/CSSPreloadScanner.cpp:
+        (WebCore::CSSPreloadScanner::emitRule):
+        * html/parser/HTMLPreloadScanner.cpp:
+        (WebCore::HTMLNames::PreloadTask::preload):
+        * html/parser/HTMLScriptRunner.cpp:
+        (WebCore::HTMLScriptRunner::requestPendingScript):
+        * inspector/InspectorResource.cpp:
+        (WebCore::InspectorResource::cachedResource):
+        * loader/Cache.cpp:
+        (WebCore::Cache::requestResource):
+        (WebCore::Cache::requestUserCSSStyleSheet):
+        (WebCore::Cache::revalidateResource):
+        (WebCore::Cache::addCachedResourceLoader):
+        (WebCore::Cache::removeCachedResourceLoader):
+        * loader/Cache.h:
+        * loader/CachedCSSStyleSheet.h:
+        * loader/CachedFont.cpp:
+        (WebCore::CachedFont::load):
+        (WebCore::CachedFont::beginLoadIfNeeded):
+        * loader/CachedFont.h:
+        * loader/CachedImage.cpp:
+        (WebCore::CachedImage::load):
+        (WebCore::CachedImage::maximumDecodedImageSize):
+        * loader/CachedImage.h:
+        * loader/CachedResource.cpp:
+        (WebCore::CachedResource::CachedResource):
+        (WebCore::CachedResource::~CachedResource):
+        (WebCore::CachedResource::load):
+        * loader/CachedResource.h:
+        (WebCore::CachedResource::load):
+        (WebCore::CachedResource::setCachedResourceLoader):
+        * loader/CachedResourceLoader.cpp: Copied from WebCore/loader/DocLoader.cpp.
+        (WebCore::CachedResourceLoader::CachedResourceLoader):
+        (WebCore::CachedResourceLoader::~CachedResourceLoader):
+        (WebCore::CachedResourceLoader::frame):
+        (WebCore::CachedResourceLoader::checkForReload):
+        (WebCore::CachedResourceLoader::requestImage):
+        (WebCore::CachedResourceLoader::requestFont):
+        (WebCore::CachedResourceLoader::requestCSSStyleSheet):
+        (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
+        (WebCore::CachedResourceLoader::requestScript):
+        (WebCore::CachedResourceLoader::requestXSLStyleSheet):
+        (WebCore::CachedResourceLoader::requestLinkPrefetch):
+        (WebCore::CachedResourceLoader::canRequest):
+        (WebCore::CachedResourceLoader::requestResource):
+        (WebCore::CachedResourceLoader::printAccessDeniedMessage):
+        (WebCore::CachedResourceLoader::setAutoLoadImages):
+        (WebCore::CachedResourceLoader::cachePolicy):
+        (WebCore::CachedResourceLoader::removeCachedResource):
+        (WebCore::CachedResourceLoader::setLoadInProgress):
+        (WebCore::CachedResourceLoader::checkCacheObjectStatus):
+        (WebCore::CachedResourceLoader::incrementRequestCount):
+        (WebCore::CachedResourceLoader::decrementRequestCount):
+        (WebCore::CachedResourceLoader::requestCount):
+        (WebCore::CachedResourceLoader::preload):
+        (WebCore::CachedResourceLoader::checkForPendingPreloads):
+        (WebCore::CachedResourceLoader::requestPreload):
+        (WebCore::CachedResourceLoader::clearPreloads):
+        (WebCore::CachedResourceLoader::clearPendingPreloads):
+        (WebCore::CachedResourceLoader::printPreloadStats):
+        * loader/CachedResourceLoader.h: Copied from WebCore/loader/DocLoader.h.
+        * loader/CachedScript.h:
+        * loader/CachedXSLStyleSheet.h:
+        * loader/DocLoader.cpp: Removed.
+        * loader/DocLoader.h: Removed.
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::isLoadingInAPISense):
+        (WebCore::DocumentLoader::subresource):
+        (WebCore::DocumentLoader::getSubresources):
+        * loader/FrameLoader.cpp:
+        (WebCore::numRequests):
+        (WebCore::FrameLoader::stopLoading):
+        (WebCore::FrameLoader::didBeginDocument):
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::createItem):
+        * loader/ImageLoader.cpp:
+        (WebCore::ImageLoader::updateFromElement):
+        * loader/Request.cpp:
+        (WebCore::Request::Request):
+        * loader/Request.h:
+        (WebCore::Request::cachedResourceLoader):
+        * loader/loader.cpp:
+        (WebCore::Loader::load):
+        (WebCore::Loader::cancelRequests):
+        (WebCore::Loader::Host::servePendingRequests):
+        (WebCore::Loader::Host::didFinishLoading):
+        (WebCore::Loader::Host::didFail):
+        (WebCore::Loader::Host::didReceiveResponse):
+        (WebCore::Loader::Host::cancelPendingRequests):
+        (WebCore::Loader::Host::cancelRequests):
+        * loader/loader.h:
+        * page/DragController.cpp:
+        (WebCore::DragController::concludeEditDrag):
+        * page/Frame.cpp:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::checkStopDelayingDeferredRepaints):
+        (WebCore::FrameView::updateDeferredRepaintDelay):
+        * page/Settings.cpp:
+        (WebCore::setLoadsImagesAutomaticallyInAllFrames):
+        * platform/android/TemporaryLinkStubs.cpp:
+        (WebCore::CheckCacheObjectStatus):
+        * platform/network/android/ResourceHandleAndroid.cpp:
+        (WebCore::ResourceHandle::start):
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        * platform/network/curl/ResourceHandleCurl.cpp:
+        * platform/network/mac/ResourceHandleMac.mm:
+        * platform/network/qt/ResourceHandleQt.cpp:
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        * platform/network/win/ResourceHandleWin.cpp:
+        * svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::requestImageResource):
+        * svg/SVGFontFaceUriElement.cpp:
+        (WebCore::SVGFontFaceUriElement::loadFont):
+        * workers/Worker.cpp:
+        * xml/XSLImportRule.cpp:
+        (WebCore::XSLImportRule::loadSheet):
+        * xml/XSLStyleSheet.h:
+        * xml/XSLStyleSheetLibxslt.cpp:
+        (WebCore::XSLStyleSheet::cachedResourceLoader):
+        (WebCore::XSLStyleSheet::parseString):
+        * xml/XSLStyleSheetQt.cpp:
+        (WebCore::XSLStyleSheet::cachedResourceLoader):
+        * xml/XSLTProcessor.cpp:
+        * xml/XSLTProcessorLibxslt.cpp:
+        (WebCore::docLoaderFunc):
+        (WebCore::setXSLTLoadCallBack):
+        (WebCore::xmlDocPtrFromNode):
+        (WebCore::XSLTProcessor::transformToString):
+
 2010-09-06  Tor Arne Vestbø  <tor.arne.vestbo at nokia.com>
 
         Reviewed by Eric Carlson.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index bd4b768..0f57413 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -1675,8 +1675,8 @@ webcore_sources += \
 	WebCore/loader/CrossOriginAccessControl.h \
 	WebCore/loader/CrossOriginPreflightResultCache.cpp \
 	WebCore/loader/CrossOriginPreflightResultCache.h \
-	WebCore/loader/DocLoader.cpp \
-	WebCore/loader/DocLoader.h \
+	WebCore/loader/CachedResourceLoader.cpp \
+	WebCore/loader/CachedResourceLoader.h \
 	WebCore/loader/DocumentLoadTiming.h \
 	WebCore/loader/DocumentLoader.cpp \
 	WebCore/loader/DocumentLoader.h \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 76c4290..c759794 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -1894,8 +1894,8 @@
             'loader/CrossOriginAccessControl.h',
             'loader/CrossOriginPreflightResultCache.cpp',
             'loader/CrossOriginPreflightResultCache.h',
-            'loader/DocLoader.cpp',
-            'loader/DocLoader.h',
+            'loader/CachedResourceLoader.cpp',
+            'loader/CachedResourceLoader.h',
             'loader/DocumentLoadTiming.h',
             'loader/DocumentLoader.cpp',
             'loader/DocumentLoader.h',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index a82a859..ea6e901 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -788,7 +788,7 @@ SOURCES += \
     loader/CachedXSLStyleSheet.cpp \
     loader/CrossOriginAccessControl.cpp \
     loader/CrossOriginPreflightResultCache.cpp \
-    loader/DocLoader.cpp \
+    loader/CachedResourceLoader.cpp \
     loader/DocumentLoader.cpp \
     loader/DocumentThreadableLoader.cpp \
     loader/DocumentWriter.cpp \
@@ -1584,7 +1584,7 @@ HEADERS += \
     loader/Cache.h \
     loader/CrossOriginAccessControl.h \
     loader/CrossOriginPreflightResultCache.h \
-    loader/DocLoader.h \
+    loader/CachedResourceLoader.h \
     loader/DocumentLoader.h \
     loader/DocumentThreadableLoader.h \
     loader/FormState.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 0cfbd3d..047bd47 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -23497,11 +23497,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\loader\DocLoader.cpp"
+				RelativePath="..\loader\CachedResourceLoader.cpp"
 				>
 			</File>
 			<File
-				RelativePath="..\loader\DocLoader.h"
+				RelativePath="..\loader\CachedResourceLoader.h"
 				>
 			</File>
 			<File
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index ad54da0..a52439e 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -4877,8 +4877,8 @@
 		BCB16C240979C3BD00467741 /* CachedScript.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C0B0979C3BD00467741 /* CachedScript.h */; };
 		BCB16C270979C3BD00467741 /* CachedXSLStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C0E0979C3BD00467741 /* CachedXSLStyleSheet.cpp */; };
 		BCB16C280979C3BD00467741 /* CachedXSLStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C0F0979C3BD00467741 /* CachedXSLStyleSheet.h */; };
-		BCB16C290979C3BD00467741 /* DocLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C100979C3BD00467741 /* DocLoader.cpp */; };
-		BCB16C2A0979C3BD00467741 /* DocLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C110979C3BD00467741 /* DocLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		BCB16C290979C3BD00467741 /* CachedResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C100979C3BD00467741 /* CachedResourceLoader.cpp */; };
+		BCB16C2A0979C3BD00467741 /* CachedResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C110979C3BD00467741 /* CachedResourceLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BCB16C2C0979C3BD00467741 /* loader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C130979C3BD00467741 /* loader.cpp */; };
 		BCB16C2D0979C3BD00467741 /* loader.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C140979C3BD00467741 /* loader.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BCB16C2E0979C3BD00467741 /* Request.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C150979C3BD00467741 /* Request.cpp */; };
@@ -10682,8 +10682,8 @@
 		BCB16C0B0979C3BD00467741 /* CachedScript.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedScript.h; sourceTree = "<group>"; };
 		BCB16C0E0979C3BD00467741 /* CachedXSLStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CachedXSLStyleSheet.cpp; sourceTree = "<group>"; };
 		BCB16C0F0979C3BD00467741 /* CachedXSLStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedXSLStyleSheet.h; sourceTree = "<group>"; };
-		BCB16C100979C3BD00467741 /* DocLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DocLoader.cpp; sourceTree = "<group>"; };
-		BCB16C110979C3BD00467741 /* DocLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DocLoader.h; sourceTree = "<group>"; };
+		BCB16C100979C3BD00467741 /* CachedResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceLoader.cpp; sourceTree = "<group>"; };
+		BCB16C110979C3BD00467741 /* CachedResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedResourceLoader.h; sourceTree = "<group>"; };
 		BCB16C130979C3BD00467741 /* loader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = loader.cpp; sourceTree = "<group>"; };
 		BCB16C140979C3BD00467741 /* loader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = loader.h; sourceTree = "<group>"; };
 		BCB16C150979C3BD00467741 /* Request.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Request.cpp; sourceTree = "<group>"; };
@@ -16522,8 +16522,8 @@
 				E1C416110F6562FD0092D2FB /* CrossOriginAccessControl.h */,
 				E1C415DD0F655D7C0092D2FB /* CrossOriginPreflightResultCache.cpp */,
 				E1C415D90F655D6F0092D2FB /* CrossOriginPreflightResultCache.h */,
-				BCB16C100979C3BD00467741 /* DocLoader.cpp */,
-				BCB16C110979C3BD00467741 /* DocLoader.h */,
+				BCB16C100979C3BD00467741 /* CachedResourceLoader.cpp */,
+				BCB16C110979C3BD00467741 /* CachedResourceLoader.h */,
 				93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */,
 				656D371E0ADBA5DE00A4554D /* DocumentLoader.h */,
 				8A12E35C11FA33280025836A /* DocumentLoadTiming.h */,
@@ -17973,7 +17973,7 @@
 				59A8F1D611A69513001AC34A /* DeviceOrientationController.h in Headers */,
 				59A85EA4119D68EC00DEF1EF /* DeviceOrientationEvent.h in Headers */,
 				B2F34FE60E82F81400F627CD /* DNS.h in Headers */,
-				BCB16C2A0979C3BD00467741 /* DocLoader.h in Headers */,
+				BCB16C2A0979C3BD00467741 /* CachedResourceLoader.h in Headers */,
 				A8185F4009765766005826D9 /* Document.h in Headers */,
 				A8185F3D09765766005826D9 /* DocumentFragment.h in Headers */,
 				656D37360ADBA5DE00A4554D /* DocumentLoader.h in Headers */,
@@ -20967,7 +20967,7 @@
 				59A8F1D411A69508001AC34A /* DeviceOrientationController.cpp in Sources */,
 				59A85EA2119D68D900DEF1EF /* DeviceOrientationEvent.cpp in Sources */,
 				B2F34FE90E82F82700F627CD /* DNSCFNet.cpp in Sources */,
-				BCB16C290979C3BD00467741 /* DocLoader.cpp in Sources */,
+				BCB16C290979C3BD00467741 /* CachedResourceLoader.cpp in Sources */,
 				A8185F3C09765766005826D9 /* Document.cpp in Sources */,
 				A8185F3F09765766005826D9 /* DocumentFragment.cpp in Sources */,
 				93E227E00AF589AD00D48324 /* DocumentLoader.cpp in Sources */,
diff --git a/WebCore/css/CSSCursorImageValue.cpp b/WebCore/css/CSSCursorImageValue.cpp
index f2e5d95..2b09ab3 100644
--- a/WebCore/css/CSSCursorImageValue.cpp
+++ b/WebCore/css/CSSCursorImageValue.cpp
@@ -22,7 +22,7 @@
 #include "config.h"
 #include "CSSCursorImageValue.h"
 
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "PlatformString.h"
 #include <wtf/MathExtras.h>
@@ -111,7 +111,7 @@ bool CSSCursorImageValue::updateIfSVGCursorIsUsed(Element* element)
     return false;
 }
 
-StyleCachedImage* CSSCursorImageValue::cachedImage(DocLoader* loader)
+StyleCachedImage* CSSCursorImageValue::cachedImage(CachedResourceLoader* loader)
 {
     String url = getStringValue();
 
diff --git a/WebCore/css/CSSCursorImageValue.h b/WebCore/css/CSSCursorImageValue.h
index 742138c..2a95c3a 100644
--- a/WebCore/css/CSSCursorImageValue.h
+++ b/WebCore/css/CSSCursorImageValue.h
@@ -42,7 +42,7 @@ public:
     IntPoint hotSpot() const { return m_hotSpot; }
 
     bool updateIfSVGCursorIsUsed(Element*);
-    virtual StyleCachedImage* cachedImage(DocLoader*);
+    virtual StyleCachedImage* cachedImage(CachedResourceLoader*);
 
 #if ENABLE(SVG)
     void removeReferencedElement(SVGElement*);
diff --git a/WebCore/css/CSSFontFaceSource.cpp b/WebCore/css/CSSFontFaceSource.cpp
index 01b5569..ad9bebc 100644
--- a/WebCore/css/CSSFontFaceSource.cpp
+++ b/WebCore/css/CSSFontFaceSource.cpp
@@ -29,7 +29,7 @@
 #include "CachedFont.h"
 #include "CSSFontFace.h"
 #include "CSSFontSelector.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "FontCache.h"
 #include "FontDescription.h"
 #include "GlyphPageTreeNode.h"
@@ -173,8 +173,8 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
         }
     } else {
         // Kick off the load now.
-        if (DocLoader* docLoader = fontSelector->docLoader())
-            m_font->beginLoadIfNeeded(docLoader);
+        if (CachedResourceLoader* cachedResourceLoader = fontSelector->cachedResourceLoader())
+            m_font->beginLoadIfNeeded(cachedResourceLoader);
         // FIXME: m_string is a URL so it makes no sense to pass it as a family name.
         SimpleFontData* tempData = fontCache()->getCachedFontData(fontDescription, m_string);
         if (!tempData)
diff --git a/WebCore/css/CSSFontSelector.cpp b/WebCore/css/CSSFontSelector.cpp
index 50627d7..d97589d 100644
--- a/WebCore/css/CSSFontSelector.cpp
+++ b/WebCore/css/CSSFontSelector.cpp
@@ -39,7 +39,7 @@
 #include "CSSUnicodeRangeValue.h"
 #include "CSSValueKeywords.h"
 #include "CSSValueList.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "FontCache.h"
 #include "FontFamilyValue.h"
@@ -80,9 +80,9 @@ bool CSSFontSelector::isEmpty() const
     return m_fonts.isEmpty();
 }
 
-DocLoader* CSSFontSelector::docLoader() const
+CachedResourceLoader* CSSFontSelector::cachedResourceLoader() const
 {
-    return m_document ? m_document->docLoader() : 0;
+    return m_document ? m_document->cachedResourceLoader() : 0;
 }
 
 void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
@@ -245,7 +245,7 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
             Settings* settings = m_document ? m_document->frame() ? m_document->frame()->settings() : 0 : 0;
             bool allowDownloading = foundSVGFont || (settings && settings->downloadableBinaryFontsEnabled());
             if (allowDownloading && item->isSupportedFormat() && m_document) {
-                CachedFont* cachedFont = m_document->docLoader()->requestFont(item->resource());
+                CachedFont* cachedFont = m_document->cachedResourceLoader()->requestFont(item->resource());
                 if (cachedFont) {
 #if ENABLE(SVG_FONTS)
                     if (foundSVGFont)
diff --git a/WebCore/css/CSSFontSelector.h b/WebCore/css/CSSFontSelector.h
index abf82cd..93ee274 100644
--- a/WebCore/css/CSSFontSelector.h
+++ b/WebCore/css/CSSFontSelector.h
@@ -38,7 +38,7 @@ class CSSFontFace;
 class CSSFontFaceRule;
 class CSSSegmentedFontFace;
 class Document;
-class DocLoader;
+class CachedResourceLoader;
 class FontDescription;
 
 class CSSFontSelector : public FontSelector {
@@ -60,7 +60,7 @@ public:
 
     bool isEmpty() const;
 
-    DocLoader* docLoader() const;
+    CachedResourceLoader* cachedResourceLoader() const;
 
 private:
     CSSFontSelector(Document*);
diff --git a/WebCore/css/CSSImageValue.cpp b/WebCore/css/CSSImageValue.cpp
index dc2d700..e657fcc 100644
--- a/WebCore/css/CSSImageValue.cpp
+++ b/WebCore/css/CSSImageValue.cpp
@@ -24,7 +24,7 @@
 #include "CSSValueKeywords.h"
 #include "Cache.h"
 #include "CachedImage.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "StyleCachedImage.h"
 #include "StylePendingImage.h"
 
@@ -59,12 +59,12 @@ StyleImage* CSSImageValue::cachedOrPendingImage()
     return m_image.get();
 }
 
-StyleCachedImage* CSSImageValue::cachedImage(DocLoader* loader)
+StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader)
 {
     return cachedImage(loader, getStringValue());
 }
 
-StyleCachedImage* CSSImageValue::cachedImage(DocLoader* loader, const String& url)
+StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader, const String& url)
 {
     if (!m_accessedImage) {
         m_accessedImage = true;
diff --git a/WebCore/css/CSSImageValue.h b/WebCore/css/CSSImageValue.h
index 4205c4f..a9c8c9b 100644
--- a/WebCore/css/CSSImageValue.h
+++ b/WebCore/css/CSSImageValue.h
@@ -27,7 +27,7 @@
 
 namespace WebCore {
 
-class DocLoader;
+class CachedResourceLoader;
 class StyleCachedImage;
 class StyleImage;
 
@@ -37,7 +37,7 @@ public:
     static PassRefPtr<CSSImageValue> create(const String& url) { return adoptRef(new CSSImageValue(url)); }
     virtual ~CSSImageValue();
 
-    virtual StyleCachedImage* cachedImage(DocLoader*);
+    virtual StyleCachedImage* cachedImage(CachedResourceLoader*);
     // Returns a StyleCachedImage if the image is cached already, otherwise a StylePendingImage.
     StyleImage* cachedOrPendingImage();
     
@@ -46,7 +46,7 @@ public:
 protected:
     CSSImageValue(const String& url);
 
-    StyleCachedImage* cachedImage(DocLoader*, const String& url);
+    StyleCachedImage* cachedImage(CachedResourceLoader*, const String& url);
     String cachedImageURL();
     void clearCachedImage();
 
diff --git a/WebCore/css/CSSImportRule.cpp b/WebCore/css/CSSImportRule.cpp
index 689d6e3..e02d244 100644
--- a/WebCore/css/CSSImportRule.cpp
+++ b/WebCore/css/CSSImportRule.cpp
@@ -23,7 +23,7 @@
 #include "CSSImportRule.h"
 
 #include "CachedCSSStyleSheet.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
@@ -115,8 +115,8 @@ void CSSImportRule::insertedIntoParent()
     if (!parentSheet)
         return;
 
-    DocLoader* docLoader = parentSheet->document()->docLoader();
-    if (!docLoader)
+    CachedResourceLoader* cachedResourceLoader = parentSheet->document()->cachedResourceLoader();
+    if (!cachedResourceLoader)
         return;
 
     String absHref = m_strHref;
@@ -135,9 +135,9 @@ void CSSImportRule::insertedIntoParent()
     }
 
     if (parentSheet->isUserStyleSheet())
-        m_cachedSheet = docLoader->requestUserCSSStyleSheet(absHref, parentSheet->charset());
+        m_cachedSheet = cachedResourceLoader->requestUserCSSStyleSheet(absHref, parentSheet->charset());
     else
-        m_cachedSheet = docLoader->requestCSSStyleSheet(absHref, parentSheet->charset());
+        m_cachedSheet = cachedResourceLoader->requestCSSStyleSheet(absHref, parentSheet->charset());
     if (m_cachedSheet) {
         // if the import rule is issued dynamically, the sheet may be
         // removed from the pending sheet count, so let the doc know
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index d6f04aa..2a7b08e 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -6711,14 +6711,14 @@ void CSSStyleSelector::loadPendingImages()
     for (HashSet<int>::const_iterator it = m_pendingImageProperties.begin(); it != end; ++it) {
         CSSPropertyID currentProperty = static_cast<CSSPropertyID>(*it);
 
-        DocLoader* docLoader = m_element->document()->docLoader();
+        CachedResourceLoader* cachedResourceLoader = m_element->document()->cachedResourceLoader();
         
         switch (currentProperty) {
             case CSSPropertyBackgroundImage: {
                 for (FillLayer* backgroundLayer = m_style->accessBackgroundLayers(); backgroundLayer; backgroundLayer = backgroundLayer->next()) {
                     if (backgroundLayer->image() && backgroundLayer->image()->isPendingImage()) {
                         CSSImageValue* imageValue = static_cast<StylePendingImage*>(backgroundLayer->image())->cssImageValue();
-                        backgroundLayer->setImage(imageValue->cachedImage(docLoader));
+                        backgroundLayer->setImage(imageValue->cachedImage(cachedResourceLoader));
                     }
                 }
                 break;
@@ -6728,7 +6728,7 @@ void CSSStyleSelector::loadPendingImages()
                 for (ContentData* contentData = const_cast<ContentData*>(m_style->contentData()); contentData; contentData = contentData->next()) {
                     if (contentData->isImage() && contentData->image()->isPendingImage()) {
                         CSSImageValue* imageValue = static_cast<StylePendingImage*>(contentData->image())->cssImageValue();
-                        contentData->setImage(imageValue->cachedImage(docLoader));
+                        contentData->setImage(imageValue->cachedImage(cachedResourceLoader));
                     }
                 }
                 break;
@@ -6740,7 +6740,7 @@ void CSSStyleSelector::loadPendingImages()
                         CursorData& currentCursor = (*cursorList)[i];
                         if (currentCursor.image()->isPendingImage()) {
                             CSSImageValue* imageValue = static_cast<StylePendingImage*>(currentCursor.image())->cssImageValue();
-                            currentCursor.setImage(imageValue->cachedImage(docLoader));
+                            currentCursor.setImage(imageValue->cachedImage(cachedResourceLoader));
                         }
                     }
                 }
@@ -6750,7 +6750,7 @@ void CSSStyleSelector::loadPendingImages()
             case CSSPropertyListStyleImage: {
                 if (m_style->listStyleImage() && m_style->listStyleImage()->isPendingImage()) {
                     CSSImageValue* imageValue = static_cast<StylePendingImage*>(m_style->listStyleImage())->cssImageValue();
-                    m_style->setListStyleImage(imageValue->cachedImage(docLoader));
+                    m_style->setListStyleImage(imageValue->cachedImage(cachedResourceLoader));
                 }
                 break;
             }
@@ -6759,7 +6759,7 @@ void CSSStyleSelector::loadPendingImages()
                 const NinePieceImage& borderImage = m_style->borderImage();
                 if (borderImage.image() && borderImage.image()->isPendingImage()) {
                     CSSImageValue* imageValue = static_cast<StylePendingImage*>(borderImage.image())->cssImageValue();
-                    m_style->setBorderImage(NinePieceImage(imageValue->cachedImage(docLoader), borderImage.slices(), borderImage.horizontalRule(), borderImage.verticalRule()));
+                    m_style->setBorderImage(NinePieceImage(imageValue->cachedImage(cachedResourceLoader), borderImage.slices(), borderImage.horizontalRule(), borderImage.verticalRule()));
                 }
                 break;
             }
@@ -6768,7 +6768,7 @@ void CSSStyleSelector::loadPendingImages()
                 const NinePieceImage& maskImage = m_style->boxReflect()->mask();
                 if (maskImage.image() && maskImage.image()->isPendingImage()) {
                     CSSImageValue* imageValue = static_cast<StylePendingImage*>(maskImage.image())->cssImageValue();
-                    m_style->boxReflect()->setMask(NinePieceImage(imageValue->cachedImage(docLoader), maskImage.slices(), maskImage.horizontalRule(), maskImage.verticalRule()));
+                    m_style->boxReflect()->setMask(NinePieceImage(imageValue->cachedImage(cachedResourceLoader), maskImage.slices(), maskImage.horizontalRule(), maskImage.verticalRule()));
                 }
                 break;
             }
@@ -6777,7 +6777,7 @@ void CSSStyleSelector::loadPendingImages()
                 const NinePieceImage& maskBoxImage = m_style->maskBoxImage();
                 if (maskBoxImage.image() && maskBoxImage.image()->isPendingImage()) {
                     CSSImageValue* imageValue = static_cast<StylePendingImage*>(maskBoxImage.image())->cssImageValue();
-                    m_style->setMaskBoxImage(NinePieceImage(imageValue->cachedImage(docLoader), maskBoxImage.slices(), maskBoxImage.horizontalRule(), maskBoxImage.verticalRule()));
+                    m_style->setMaskBoxImage(NinePieceImage(imageValue->cachedImage(cachedResourceLoader), maskBoxImage.slices(), maskBoxImage.horizontalRule(), maskBoxImage.verticalRule()));
                 }
                 break;
             }
@@ -6786,7 +6786,7 @@ void CSSStyleSelector::loadPendingImages()
                 for (FillLayer* maskLayer = m_style->accessMaskLayers(); maskLayer; maskLayer = maskLayer->next()) {
                     if (maskLayer->image() && maskLayer->image()->isPendingImage()) {
                         CSSImageValue* imageValue = static_cast<StylePendingImage*>(maskLayer->image())->cssImageValue();
-                        maskLayer->setImage(imageValue->cachedImage(docLoader));
+                        maskLayer->setImage(imageValue->cachedImage(cachedResourceLoader));
                     }
                 }
                 break;
diff --git a/WebCore/css/CSSStyleSheet.h b/WebCore/css/CSSStyleSheet.h
index 3b18522..725518f 100644
--- a/WebCore/css/CSSStyleSheet.h
+++ b/WebCore/css/CSSStyleSheet.h
@@ -29,7 +29,7 @@ namespace WebCore {
 struct CSSNamespace;
 class CSSParser;
 class CSSRule;
-class DocLoader;
+class CachedResourceLoader;
 class Document;
 
 typedef int ExceptionCode;
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index b82bc05..ba02dec 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -47,7 +47,7 @@
 #include "DOMWindow.h"
 #include "DeviceMotionEvent.h"
 #include "DeviceOrientationEvent.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "DocumentFragment.h"
 #include "DocumentLoader.h"
 #include "DocumentType.h"
@@ -425,7 +425,7 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
 
     m_markers = new DocumentMarkerController();
 
-    m_docLoader = new DocLoader(this);
+    m_cachedResourceLoader = new CachedResourceLoader(this);
 
     m_visuallyOrdered = false;
     m_bParsing = false;
@@ -542,7 +542,7 @@ Document::~Document()
     ASSERT(!m_parser || m_parser->refCount() == 1);
     detachParser();
     m_document = 0;
-    m_docLoader.clear();
+    m_cachedResourceLoader.clear();
 
     m_renderArena.clear();
 
@@ -1998,7 +1998,7 @@ void Document::implicitClose()
     detachParser();
 
     // Parser should have picked up all preloads by now
-    m_docLoader->clearPreloads();
+    m_cachedResourceLoader->clearPreloads();
 
     // Create a head and a body if we don't have those yet (e.g. for about:blank).
     if (!this->body() && isHTMLDocument()) {
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index 1bec608..dc7d9e8 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -64,7 +64,7 @@ class DOMImplementation;
 class DOMSelection;
 class DOMWindow;
 class DatabaseThread;
-class DocLoader;
+class CachedResourceLoader;
 class DocumentFragment;
 class DocumentType;
 class DocumentWeakReference;
@@ -509,7 +509,7 @@ public:
     void pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageSize, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft);
 
     static void updateStyleForAllDocuments(); // FIXME: Try to reduce the # of calls to this function.
-    DocLoader* docLoader() { return m_docLoader.get(); }
+    CachedResourceLoader* cachedResourceLoader() { return m_cachedResourceLoader.get(); }
 
     virtual void attach();
     virtual void detach();
@@ -1072,7 +1072,7 @@ private:
     bool m_didCalculateStyleSelector;
 
     Frame* m_frame;
-    OwnPtr<DocLoader> m_docLoader;
+    OwnPtr<CachedResourceLoader> m_cachedResourceLoader;
     RefPtr<DocumentParser> m_parser;
     bool m_wellFormed;
 
diff --git a/WebCore/dom/ProcessingInstruction.cpp b/WebCore/dom/ProcessingInstruction.cpp
index 0e673d4..0b4410d 100644
--- a/WebCore/dom/ProcessingInstruction.cpp
+++ b/WebCore/dom/ProcessingInstruction.cpp
@@ -25,7 +25,7 @@
 #include "CachedCSSStyleSheet.h"
 #include "CachedXSLStyleSheet.h"
 #include "Document.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "ExceptionCode.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -159,7 +159,7 @@ void ProcessingInstruction::checkStyleSheet()
             
 #if ENABLE(XSLT)
             if (m_isXSL)
-                m_cachedSheet = document()->docLoader()->requestXSLStyleSheet(url);
+                m_cachedSheet = document()->cachedResourceLoader()->requestXSLStyleSheet(url);
             else
 #endif
             {
@@ -167,7 +167,7 @@ void ProcessingInstruction::checkStyleSheet()
                 if (charset.isEmpty())
                     charset = document()->frame()->loader()->writer()->encoding();
 
-                m_cachedSheet = document()->docLoader()->requestCSSStyleSheet(url, charset);
+                m_cachedSheet = document()->cachedResourceLoader()->requestCSSStyleSheet(url, charset);
             }
             if (m_cachedSheet)
                 m_cachedSheet->addClient(this);
diff --git a/WebCore/dom/ScriptElement.cpp b/WebCore/dom/ScriptElement.cpp
index 8626bb4..abc4c63 100644
--- a/WebCore/dom/ScriptElement.cpp
+++ b/WebCore/dom/ScriptElement.cpp
@@ -26,7 +26,7 @@
 
 #include "AsyncScriptRunner.h"
 #include "CachedScript.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "DocumentParser.h"
 #include "Frame.h"
@@ -170,7 +170,7 @@ void ScriptElementData::requestScript(const String& sourceUrl)
         return;
 
     ASSERT(!m_cachedScript);
-    m_cachedScript = document->docLoader()->requestScript(sourceUrl, scriptCharset());
+    m_cachedScript = document->cachedResourceLoader()->requestScript(sourceUrl, scriptCharset());
     m_requested = true;
 
     // m_createdByParser is never reset - always resied at the initial value set while parsing.
diff --git a/WebCore/dom/XMLDocumentParser.cpp b/WebCore/dom/XMLDocumentParser.cpp
index 5566de3..4ae18a1 100644
--- a/WebCore/dom/XMLDocumentParser.cpp
+++ b/WebCore/dom/XMLDocumentParser.cpp
@@ -29,7 +29,7 @@
 #include "CDATASection.h"
 #include "CachedScript.h"
 #include "Comment.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "DocumentFragment.h"
 #include "DocumentType.h"
diff --git a/WebCore/dom/XMLDocumentParser.h b/WebCore/dom/XMLDocumentParser.h
index df0f92a..a64d7e4 100644
--- a/WebCore/dom/XMLDocumentParser.h
+++ b/WebCore/dom/XMLDocumentParser.h
@@ -45,7 +45,7 @@ namespace WebCore {
 
     class Node;
     class CachedScript;
-    class DocLoader;
+    class CachedResourceLoader;
     class DocumentFragment;
     class Document;
     class Element;
@@ -220,7 +220,7 @@ public:
     };
 
 #if ENABLE(XSLT)
-void* xmlDocPtrForString(DocLoader*, const String& source, const String& url);
+void* xmlDocPtrForString(CachedResourceLoader*, const String& source, const String& url);
 #endif
 
 HashMap<String, String> parseAttributes(const String&, bool& attrsOK);
diff --git a/WebCore/dom/XMLDocumentParserLibxml2.cpp b/WebCore/dom/XMLDocumentParserLibxml2.cpp
index d99ab4b..927fbbe 100644
--- a/WebCore/dom/XMLDocumentParserLibxml2.cpp
+++ b/WebCore/dom/XMLDocumentParserLibxml2.cpp
@@ -29,7 +29,7 @@
 #include "CDATASection.h"
 #include "CachedScript.h"
 #include "Comment.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "DocumentFragment.h"
 #include "DocumentType.h"
@@ -338,7 +338,7 @@ static int matchFunc(const char*)
 {
     // Only match loads initiated due to uses of libxml2 from within XMLDocumentParser to avoid
     // interfering with client applications that also use libxml2.  http://bugs.webkit.org/show_bug.cgi?id=17353
-    return XMLDocumentParserScope::currentDocLoader && currentThread() == libxmlLoaderThread;
+    return XMLDocumentParserScope::currentCachedResourceLoader && currentThread() == libxmlLoaderThread;
 }
 
 class OffsetBuffer {
@@ -400,8 +400,8 @@ static bool shouldAllowExternalLoad(const KURL& url)
     // retrieved content.  If we had more context, we could potentially allow
     // the parser to load a DTD.  As things stand, we take the conservative
     // route and allow same-origin requests only.
-    if (!XMLDocumentParserScope::currentDocLoader->doc()->securityOrigin()->canRequest(url)) {
-        XMLDocumentParserScope::currentDocLoader->printAccessDeniedMessage(url);
+    if (!XMLDocumentParserScope::currentCachedResourceLoader->doc()->securityOrigin()->canRequest(url)) {
+        XMLDocumentParserScope::currentCachedResourceLoader->printAccessDeniedMessage(url);
         return false;
     }
 
@@ -410,7 +410,7 @@ static bool shouldAllowExternalLoad(const KURL& url)
 
 static void* openFunc(const char* uri)
 {
-    ASSERT(XMLDocumentParserScope::currentDocLoader);
+    ASSERT(XMLDocumentParserScope::currentCachedResourceLoader);
     ASSERT(currentThread() == libxmlLoaderThread);
 
     KURL url(KURL(), uri);
@@ -424,12 +424,12 @@ static void* openFunc(const char* uri)
 
 
     {
-        DocLoader* docLoader = XMLDocumentParserScope::currentDocLoader;
+        CachedResourceLoader* cachedResourceLoader = XMLDocumentParserScope::currentCachedResourceLoader;
         XMLDocumentParserScope scope(0);
         // FIXME: We should restore the original global error handler as well.
 
-        if (docLoader->frame())
-            docLoader->frame()->loader()->loadResourceSynchronously(url, AllowStoredCredentials, error, response, data);
+        if (cachedResourceLoader->frame())
+            cachedResourceLoader->frame()->loader()->loadResourceSynchronously(url, AllowStoredCredentials, error, response, data);
     }
 
     // We have to check the URL again after the load to catch redirects.
@@ -655,7 +655,7 @@ void XMLDocumentParser::doWrite(const String& parseString)
         RefPtr<XMLDocumentParser> protect(this);
 
         switchToUTF16(context->context());
-        XMLDocumentParserScope scope(document()->docLoader());
+        XMLDocumentParserScope scope(document()->cachedResourceLoader());
         xmlParseChunk(context->context(), reinterpret_cast<const char*>(parseString.characters()), sizeof(UChar) * parseString.length(), 0);
 
         // JavaScript (which may be run under the xmlParseChunk callstack) may
@@ -884,7 +884,7 @@ void XMLDocumentParser::endElementNs()
             // we have a src attribute
             String scriptCharset = scriptElement->scriptCharset();
             if (element->dispatchBeforeLoadEvent(scriptHref) &&
-                (m_pendingScript = document()->docLoader()->requestScript(scriptHref, scriptCharset))) {
+                (m_pendingScript = document()->cachedResourceLoader()->requestScript(scriptHref, scriptCharset))) {
                 m_scriptElement = element;
                 m_pendingScript->addClient(this);
 
@@ -1299,7 +1299,7 @@ void XMLDocumentParser::initializeParserContext(const char* chunk)
     m_sawXSLTransform = false;
     m_sawFirstElement = false;
 
-    XMLDocumentParserScope scope(document()->docLoader());
+    XMLDocumentParserScope scope(document()->cachedResourceLoader());
     if (m_parsingFragment)
         m_context = XMLParserContext::createMemoryParser(&sax, this, chunk);
     else {
@@ -1312,7 +1312,7 @@ void XMLDocumentParser::doEnd()
 {
 #if ENABLE(XSLT)
     if (m_sawXSLTransform) {
-        void* doc = xmlDocPtrForString(document()->docLoader(), m_originalSourceForTransform, document()->url().string());
+        void* doc = xmlDocPtrForString(document()->cachedResourceLoader(), m_originalSourceForTransform, document()->url().string());
         document()->setTransformSource(new TransformSource(doc));
 
         document()->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets.
@@ -1328,7 +1328,7 @@ void XMLDocumentParser::doEnd()
     if (m_context) {
         // Tell libxml we're done.
         {
-            XMLDocumentParserScope scope(document()->docLoader());
+            XMLDocumentParserScope scope(document()->cachedResourceLoader());
             xmlParseChunk(context(), 0, 0, 1);
         }
 
@@ -1337,7 +1337,7 @@ void XMLDocumentParser::doEnd()
 }
 
 #if ENABLE(XSLT)
-void* xmlDocPtrForString(DocLoader* docLoader, const String& source, const String& url)
+void* xmlDocPtrForString(CachedResourceLoader* cachedResourceLoader, const String& source, const String& url)
 {
     if (source.isEmpty())
         return 0;
@@ -1348,7 +1348,7 @@ void* xmlDocPtrForString(DocLoader* docLoader, const String& source, const Strin
     const UChar BOM = 0xFEFF;
     const unsigned char BOMHighByte = *reinterpret_cast<const unsigned char*>(&BOM);
 
-    XMLDocumentParserScope scope(docLoader, errorFunc, 0);
+    XMLDocumentParserScope scope(cachedResourceLoader, errorFunc, 0);
     xmlDocPtr sourceDoc = xmlReadMemory(reinterpret_cast<const char*>(source.characters()),
                                         source.length() * sizeof(UChar),
                                         url.latin1().data(),
diff --git a/WebCore/dom/XMLDocumentParserQt.cpp b/WebCore/dom/XMLDocumentParserQt.cpp
index c1f59ac..75a20be 100644
--- a/WebCore/dom/XMLDocumentParserQt.cpp
+++ b/WebCore/dom/XMLDocumentParserQt.cpp
@@ -29,7 +29,7 @@
 #include "CDATASection.h"
 #include "CachedScript.h"
 #include "Comment.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "DocumentFragment.h"
 #include "DocumentType.h"
@@ -578,7 +578,7 @@ void XMLDocumentParser::parseEndElement()
             // we have a src attribute
             String scriptCharset = scriptElement->scriptCharset();
             if (element->dispatchBeforeLoadEvent(scriptHref) &&
-                (m_pendingScript = document()->docLoader()->requestScript(scriptHref, scriptCharset))) {
+                (m_pendingScript = document()->cachedResourceLoader()->requestScript(scriptHref, scriptCharset))) {
                 m_scriptElement = element;
                 m_pendingScript->addClient(this);
 
diff --git a/WebCore/dom/XMLDocumentParserScope.cpp b/WebCore/dom/XMLDocumentParserScope.cpp
index 8afe49d..0a473ed 100644
--- a/WebCore/dom/XMLDocumentParserScope.cpp
+++ b/WebCore/dom/XMLDocumentParserScope.cpp
@@ -28,27 +28,27 @@
 
 namespace WebCore {
 
-DocLoader* XMLDocumentParserScope::currentDocLoader = 0;
+CachedResourceLoader* XMLDocumentParserScope::currentCachedResourceLoader = 0;
 
-XMLDocumentParserScope::XMLDocumentParserScope(DocLoader* docLoader)
-    : m_oldDocLoader(currentDocLoader)
+XMLDocumentParserScope::XMLDocumentParserScope(CachedResourceLoader* cachedResourceLoader)
+    : m_oldCachedResourceLoader(currentCachedResourceLoader)
 #if ENABLE(XSLT)
     , m_oldGenericErrorFunc(xmlGenericError)
     , m_oldStructuredErrorFunc(xmlStructuredError)
     , m_oldErrorContext(xmlGenericErrorContext)
 #endif
 {
-    currentDocLoader = docLoader;
+    currentCachedResourceLoader = cachedResourceLoader;
 }
 
 #if ENABLE(XSLT)
-XMLDocumentParserScope::XMLDocumentParserScope(DocLoader* docLoader, xmlGenericErrorFunc genericErrorFunc, xmlStructuredErrorFunc structuredErrorFunc, void* errorContext)
-    : m_oldDocLoader(currentDocLoader)
+XMLDocumentParserScope::XMLDocumentParserScope(CachedResourceLoader* cachedResourceLoader, xmlGenericErrorFunc genericErrorFunc, xmlStructuredErrorFunc structuredErrorFunc, void* errorContext)
+    : m_oldCachedResourceLoader(currentCachedResourceLoader)
     , m_oldGenericErrorFunc(xmlGenericError)
     , m_oldStructuredErrorFunc(xmlStructuredError)
     , m_oldErrorContext(xmlGenericErrorContext)
 {
-    currentDocLoader = docLoader;
+    currentCachedResourceLoader = cachedResourceLoader;
     if (genericErrorFunc)
         xmlSetGenericErrorFunc(errorContext, genericErrorFunc);
     if (structuredErrorFunc)
@@ -58,7 +58,7 @@ XMLDocumentParserScope::XMLDocumentParserScope(DocLoader* docLoader, xmlGenericE
 
 XMLDocumentParserScope::~XMLDocumentParserScope()
 {
-    currentDocLoader = m_oldDocLoader;
+    currentCachedResourceLoader = m_oldCachedResourceLoader;
 #if ENABLE(XSLT)
     xmlSetGenericErrorFunc(m_oldErrorContext, m_oldGenericErrorFunc);
     xmlSetStructuredErrorFunc(m_oldErrorContext, m_oldStructuredErrorFunc);
diff --git a/WebCore/dom/XMLDocumentParserScope.h b/WebCore/dom/XMLDocumentParserScope.h
index bdf629d..58e8a6b 100644
--- a/WebCore/dom/XMLDocumentParserScope.h
+++ b/WebCore/dom/XMLDocumentParserScope.h
@@ -34,21 +34,21 @@
 
 namespace WebCore {
 
-    class DocLoader;
+    class CachedResourceLoader;
 
     class XMLDocumentParserScope : public Noncopyable {
     public:
-        XMLDocumentParserScope(DocLoader* docLoader);
+        XMLDocumentParserScope(CachedResourceLoader* cachedResourceLoader);
         ~XMLDocumentParserScope();
 
-        static DocLoader* currentDocLoader;
+        static CachedResourceLoader* currentCachedResourceLoader;
 
 #if ENABLE(XSLT)
-        XMLDocumentParserScope(DocLoader* docLoader, xmlGenericErrorFunc genericErrorFunc, xmlStructuredErrorFunc structuredErrorFunc = 0, void* errorContext = 0);
+        XMLDocumentParserScope(CachedResourceLoader* cachedResourceLoader, xmlGenericErrorFunc genericErrorFunc, xmlStructuredErrorFunc structuredErrorFunc = 0, void* errorContext = 0);
 #endif
 
     private:
-        DocLoader* m_oldDocLoader;
+        CachedResourceLoader* m_oldCachedResourceLoader;
 
 #if ENABLE(XSLT)
         xmlGenericErrorFunc m_oldGenericErrorFunc;
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 117292c..9e41a62 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -40,7 +40,7 @@
 #include "CreateLinkCommand.h"
 #include "DeleteButtonController.h"
 #include "DeleteSelectionCommand.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "DocumentFragment.h"
 #include "EditorClient.h"
 #include "EventHandler.h"
@@ -1190,7 +1190,7 @@ void Editor::paste()
         return; // DHTML did the whole operation
     if (!canPaste())
         return;
-    DocLoader* loader = m_frame->document()->docLoader();
+    CachedResourceLoader* loader = m_frame->document()->cachedResourceLoader();
     loader->setAllowStaleResources(true);
     if (m_frame->selection()->isContentRichlyEditable())
         pasteWithPasteboard(Pasteboard::generalPasteboard(), true);
diff --git a/WebCore/editing/mac/EditorMac.mm b/WebCore/editing/mac/EditorMac.mm
index 2c5a602..143db37 100644
--- a/WebCore/editing/mac/EditorMac.mm
+++ b/WebCore/editing/mac/EditorMac.mm
@@ -27,7 +27,7 @@
 #import "Editor.h"
 
 #import "ClipboardMac.h"
-#import "DocLoader.h"
+#import "CachedResourceLoader.h"
 #import "Frame.h"
 #import "FrameView.h"
 
@@ -63,7 +63,7 @@ void Editor::paste()
     FrameView* view = m_frame->view();
     if (!view)
         return;
-    DocLoader* loader = m_frame->document()->docLoader();
+    CachedResourceLoader* loader = m_frame->document()->cachedResourceLoader();
     loader->setAllowStaleResources(true);
     [view->documentView() tryToPerform:@selector(paste:) with:nil];
     loader->setAllowStaleResources(false);
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index 712f81e..a372b9c 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -27,7 +27,7 @@
 #include "Attribute.h"
 #include "CSSHelper.h"
 #include "CachedCSSStyleSheet.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -194,7 +194,7 @@ void HTMLLinkElement::process()
 
 #if ENABLE(LINK_PREFETCH)
     if (m_relAttribute.m_isLinkPrefetch && m_url.isValid() && document()->frame())
-        document()->docLoader()->requestLinkPrefetch(m_url);
+        document()->cachedResourceLoader()->requestLinkPrefetch(m_url);
 #endif
 
     bool acceptIfTypeContainsTextCSS = document()->page() && document()->page()->settings() && document()->page()->settings()->treatsAnyTextCSSLinkAsStylesheet();
@@ -225,7 +225,7 @@ void HTMLLinkElement::process()
         if (!isAlternate())
             document()->addPendingSheet();
 
-        m_cachedSheet = document()->docLoader()->requestCSSStyleSheet(m_url, charset);
+        m_cachedSheet = document()->cachedResourceLoader()->requestCSSStyleSheet(m_url, charset);
         
         if (m_cachedSheet)
             m_cachedSheet->addClient(this);
diff --git a/WebCore/html/parser/CSSPreloadScanner.cpp b/WebCore/html/parser/CSSPreloadScanner.cpp
index 729103e..6ac923d 100644
--- a/WebCore/html/parser/CSSPreloadScanner.cpp
+++ b/WebCore/html/parser/CSSPreloadScanner.cpp
@@ -30,7 +30,7 @@
 
 #include "CSSHelper.h"
 #include "CachedCSSStyleSheet.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "HTMLToken.h"
 
@@ -151,7 +151,7 @@ void CSSPreloadScanner::emitRule()
         String value(m_ruleValue.data(), m_ruleValue.size());
         String url = deprecatedParseURL(value);
         if (!url.isEmpty())
-            m_document->docLoader()->preload(CachedResource::CSSStyleSheet, url, String(), m_scanningBody);
+            m_document->cachedResourceLoader()->preload(CachedResource::CSSStyleSheet, url, String(), m_scanningBody);
     }
     m_rule.clear();
     m_ruleValue.clear();
diff --git a/WebCore/html/parser/HTMLPreloadScanner.cpp b/WebCore/html/parser/HTMLPreloadScanner.cpp
index 7aafd90..5283fa3 100644
--- a/WebCore/html/parser/HTMLPreloadScanner.cpp
+++ b/WebCore/html/parser/HTMLPreloadScanner.cpp
@@ -29,7 +29,7 @@
 #include "HTMLPreloadScanner.h"
 
 #include "CSSHelper.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "HTMLTokenizer.h"
 #include "HTMLTreeBuilder.h"
@@ -98,13 +98,13 @@ public:
         if (m_urlToLoad.isEmpty())
             return;
 
-        DocLoader* docLoader = document->docLoader();
+        CachedResourceLoader* cachedResourceLoader = document->cachedResourceLoader();
         if (m_tagName == scriptTag)
-            docLoader->preload(CachedResource::Script, m_urlToLoad, m_charset, scanningBody);
+            cachedResourceLoader->preload(CachedResource::Script, m_urlToLoad, m_charset, scanningBody);
         else if (m_tagName == imgTag) 
-            docLoader->preload(CachedResource::ImageResource, m_urlToLoad, String(), scanningBody);
+            cachedResourceLoader->preload(CachedResource::ImageResource, m_urlToLoad, String(), scanningBody);
         else if (m_tagName == linkTag && m_linkIsStyleSheet) 
-            docLoader->preload(CachedResource::CSSStyleSheet, m_urlToLoad, m_charset, scanningBody);
+            cachedResourceLoader->preload(CachedResource::CSSStyleSheet, m_urlToLoad, m_charset, scanningBody);
     }
 
     const AtomicString& tagName() const { return m_tagName; }
diff --git a/WebCore/html/parser/HTMLScriptRunner.cpp b/WebCore/html/parser/HTMLScriptRunner.cpp
index 764bf01..e314a21 100644
--- a/WebCore/html/parser/HTMLScriptRunner.cpp
+++ b/WebCore/html/parser/HTMLScriptRunner.cpp
@@ -28,7 +28,7 @@
 
 #include "Attribute.h"
 #include "CachedScript.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Element.h"
 #include "Event.h"
 #include "Frame.h"
@@ -298,7 +298,7 @@ bool HTMLScriptRunner::requestPendingScript(PendingScript& pendingScript, Elemen
         return false;
     pendingScript.adoptElement(script);
     // This should correctly return 0 for empty or invalid srcValues.
-    CachedScript* cachedScript = m_document->docLoader()->requestScript(srcValue, toScriptElement(script)->scriptCharset());
+    CachedScript* cachedScript = m_document->cachedResourceLoader()->requestScript(srcValue, toScriptElement(script)->scriptCharset());
     if (!cachedScript) {
         notImplemented(); // Dispatch error event.
         return false;
diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp
index 131ce95..be77827 100644
--- a/WebCore/inspector/InspectorResource.cpp
+++ b/WebCore/inspector/InspectorResource.cpp
@@ -35,7 +35,7 @@
 
 #include "Cache.h"
 #include "CachedResource.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "DocumentLoader.h"
 #include "Frame.h"
 #include "InspectorFrontend.h"
@@ -264,11 +264,11 @@ void InspectorResource::releaseScriptObject(InspectorFrontend* frontend)
 
 CachedResource* InspectorResource::cachedResource() const
 {
-    // Try hard to find a corresponding CachedResource. During preloading, DocLoader may not have the resource in document resources set yet,
+    // Try hard to find a corresponding CachedResource. During preloading, CachedResourceLoader may not have the resource in document resources set yet,
     // but Inspector will already try to fetch data that is only available via CachedResource (and it won't update once the resource is added,
     // because m_changes will not have the appropriate bits set).
     const String& url = m_requestURL.string();
-    CachedResource* cachedResource = m_frame->document()->docLoader()->cachedResource(url);
+    CachedResource* cachedResource = m_frame->document()->cachedResourceLoader()->cachedResource(url);
     if (!cachedResource)
         cachedResource = cache()->resourceForURL(url);
     return cachedResource;
diff --git a/WebCore/loader/Cache.cpp b/WebCore/loader/Cache.cpp
index 3e2576f..7acbd56 100644
--- a/WebCore/loader/Cache.cpp
+++ b/WebCore/loader/Cache.cpp
@@ -28,7 +28,7 @@
 #include "CachedImage.h"
 #include "CachedScript.h"
 #include "CachedXSLStyleSheet.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "FrameLoader.h"
 #include "FrameLoaderTypes.h"
@@ -93,7 +93,7 @@ static CachedResource* createResource(CachedResource::Type type, const KURL& url
     return 0;
 }
 
-CachedResource* Cache::requestResource(DocLoader* docLoader, CachedResource::Type type, const KURL& url, const String& charset, bool requestIsPreload)
+CachedResource* Cache::requestResource(CachedResourceLoader* cachedResourceLoader, CachedResource::Type type, const KURL& url, const String& charset, bool requestIsPreload)
 {
     // FIXME: Do we really need to special-case an empty URL?
     // Would it be better to just go on with the cache code and let it fail later?
@@ -106,8 +106,8 @@ CachedResource* Cache::requestResource(DocLoader* docLoader, CachedResource::Typ
     if (resource && requestIsPreload && !resource->isPreloaded())
         return 0;
     
-    if (SecurityOrigin::restrictAccessToLocal() && !SecurityOrigin::canDisplay(url, String(), docLoader->doc())) {
-        Document* doc = docLoader->doc();
+    if (SecurityOrigin::restrictAccessToLocal() && !SecurityOrigin::canDisplay(url, String(), cachedResourceLoader->doc())) {
+        Document* doc = cachedResourceLoader->doc();
         if (doc && !requestIsPreload)
             FrameLoader::reportLocalLoadFailed(doc->frame(), url.string());
         return 0;
@@ -122,7 +122,7 @@ CachedResource* Cache::requestResource(DocLoader* docLoader, CachedResource::Typ
         // FIXME: CachedResource should just use normal refcounting instead.
         resource->setInCache(true);
         
-        resource->load(docLoader);
+        resource->load(cachedResourceLoader);
         
         if (resource->errorOccurred()) {
             // We don't support immediate loads, but we do support immediate failure.
@@ -138,7 +138,7 @@ CachedResource* Cache::requestResource(DocLoader* docLoader, CachedResource::Typ
         else {
             // Kick the resource out of the cache, because the cache is disabled.
             resource->setInCache(false);
-            resource->setDocLoader(docLoader);
+            resource->setCachedResourceLoader(cachedResourceLoader);
         }
     }
 
@@ -153,7 +153,7 @@ CachedResource* Cache::requestResource(DocLoader* docLoader, CachedResource::Typ
     return resource;
 }
     
-CachedCSSStyleSheet* Cache::requestUserCSSStyleSheet(DocLoader* docLoader, const String& url, const String& charset)
+CachedCSSStyleSheet* Cache::requestUserCSSStyleSheet(CachedResourceLoader* cachedResourceLoader, const String& url, const String& charset)
 {
     CachedCSSStyleSheet* userSheet;
     if (CachedResource* existing = resourceForURL(url)) {
@@ -167,7 +167,7 @@ CachedCSSStyleSheet* Cache::requestUserCSSStyleSheet(DocLoader* docLoader, const
         // FIXME: CachedResource should just use normal refcounting instead.
         userSheet->setInCache(true);
         // Don't load incrementally, skip load checks, don't send resource load callbacks.
-        userSheet->load(docLoader, false, SkipSecurityCheck, false);
+        userSheet->load(cachedResourceLoader, false, SkipSecurityCheck, false);
         if (!disabled())
             m_resources.set(url, userSheet);
         else
@@ -182,7 +182,7 @@ CachedCSSStyleSheet* Cache::requestUserCSSStyleSheet(DocLoader* docLoader, const
     return userSheet;
 }
     
-void Cache::revalidateResource(CachedResource* resource, DocLoader* docLoader)
+void Cache::revalidateResource(CachedResource* resource, CachedResourceLoader* cachedResourceLoader)
 {
     ASSERT(resource);
     ASSERT(resource->inCache());
@@ -201,7 +201,7 @@ void Cache::revalidateResource(CachedResource* resource, DocLoader* docLoader)
     m_resources.set(url, newResource);
     newResource->setInCache(true);
     resourceAccessed(newResource);
-    newResource->load(docLoader);
+    newResource->load(cachedResourceLoader);
 }
     
 void Cache::revalidationSucceeded(CachedResource* revalidatingResource, const ResourceResponse& response)
@@ -422,14 +422,14 @@ void Cache::evict(CachedResource* resource)
         delete resource;
 }
 
-void Cache::addDocLoader(DocLoader* docLoader)
+void Cache::addCachedResourceLoader(CachedResourceLoader* cachedResourceLoader)
 {
-    m_docLoaders.add(docLoader);
+    m_cachedResourceLoaders.add(cachedResourceLoader);
 }
 
-void Cache::removeDocLoader(DocLoader* docLoader)
+void Cache::removeCachedResourceLoader(CachedResourceLoader* cachedResourceLoader)
 {
-    m_docLoaders.remove(docLoader);
+    m_cachedResourceLoaders.remove(cachedResourceLoader);
 }
 
 static inline unsigned fastLog2(unsigned i)
diff --git a/WebCore/loader/Cache.h b/WebCore/loader/Cache.h
index 763f1f3..5743696 100644
--- a/WebCore/loader/Cache.h
+++ b/WebCore/loader/Cache.h
@@ -39,7 +39,7 @@ namespace WebCore  {
 
 class CachedCSSStyleSheet;
 class CachedResource;
-class DocLoader;
+class CachedResourceLoader;
 class KURL;
 
 // This cache holds subresources used by Web pages: images, scripts, stylesheets, etc.
@@ -93,11 +93,11 @@ public:
 
     // Request resources from the cache.  A load will be initiated and a cache object created if the object is not
     // found in the cache.
-    CachedResource* requestResource(DocLoader*, CachedResource::Type, const KURL& url, const String& charset, bool isPreload = false);
+    CachedResource* requestResource(CachedResourceLoader*, CachedResource::Type, const KURL& url, const String& charset, bool isPreload = false);
 
-    CachedCSSStyleSheet* requestUserCSSStyleSheet(DocLoader*, const String& url, const String& charset);
+    CachedCSSStyleSheet* requestUserCSSStyleSheet(CachedResourceLoader*, const String& url, const String& charset);
     
-    void revalidateResource(CachedResource*, DocLoader*);
+    void revalidateResource(CachedResource*, CachedResourceLoader*);
     void revalidationSucceeded(CachedResource* revalidatingResource, const ResourceResponse&);
     void revalidationFailed(CachedResource* revalidatingResource);
     
@@ -129,8 +129,8 @@ public:
     // Remove an existing cache entry from both the resource map and from the LRU list.
     void remove(CachedResource* resource) { evict(resource); }
 
-    void addDocLoader(DocLoader*);
-    void removeDocLoader(DocLoader*);
+    void addCachedResourceLoader(CachedResourceLoader*);
+    void removeCachedResourceLoader(CachedResourceLoader*);
 
     CachedResource* resourceForURL(const String&);
 
@@ -171,7 +171,7 @@ private:
     void evict(CachedResource*);
 
     // Member variables.
-    HashSet<DocLoader*> m_docLoaders;
+    HashSet<CachedResourceLoader*> m_cachedResourceLoaders;
     Loader m_loader;
 
     bool m_disabled;  // Whether or not the cache is enabled.
diff --git a/WebCore/loader/CachedCSSStyleSheet.h b/WebCore/loader/CachedCSSStyleSheet.h
index f5bf042..03bde69 100644
--- a/WebCore/loader/CachedCSSStyleSheet.h
+++ b/WebCore/loader/CachedCSSStyleSheet.h
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-    class DocLoader;
+    class CachedResourceLoader;
     class TextResourceDecoder;
 
     class CachedCSSStyleSheet : public CachedResource {
diff --git a/WebCore/loader/CachedFont.cpp b/WebCore/loader/CachedFont.cpp
index 272166e..166fa85 100644
--- a/WebCore/loader/CachedFont.cpp
+++ b/WebCore/loader/CachedFont.cpp
@@ -71,7 +71,7 @@ CachedFont::~CachedFont()
 #endif
 }
 
-void CachedFont::load(DocLoader*)
+void CachedFont::load(CachedResourceLoader*)
 {
     // Don't load the file yet.  Wait for an access before triggering the load.
     setLoading(true);
@@ -94,7 +94,7 @@ void CachedFont::data(PassRefPtr<SharedBuffer> data, bool allDataReceived)
     checkNotify();
 }
 
-void CachedFont::beginLoadIfNeeded(DocLoader* dl)
+void CachedFont::beginLoadIfNeeded(CachedResourceLoader* dl)
 {
     if (!m_loadInitiated) {
         m_loadInitiated = true;
diff --git a/WebCore/loader/CachedFont.h b/WebCore/loader/CachedFont.h
index 01c8c9c..95c2423 100644
--- a/WebCore/loader/CachedFont.h
+++ b/WebCore/loader/CachedFont.h
@@ -37,7 +37,7 @@
 
 namespace WebCore {
 
-class DocLoader;
+class CachedResourceLoader;
 class Cache;
 class FontPlatformData;
 class SVGFontElement;
@@ -49,7 +49,7 @@ public:
     CachedFont(const String& url);
     virtual ~CachedFont();
     
-    virtual void load(DocLoader* docLoader);
+    virtual void load(CachedResourceLoader* cachedResourceLoader);
 
     virtual void didAddClient(CachedResourceClient*);
     virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived);
@@ -59,7 +59,7 @@ public:
 
     void checkNotify();
 
-    void beginLoadIfNeeded(DocLoader* dl);
+    void beginLoadIfNeeded(CachedResourceLoader* dl);
 
     bool ensureCustomFontData();
     FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
diff --git a/WebCore/loader/CachedImage.cpp b/WebCore/loader/CachedImage.cpp
index 9ae8d20..202f32c 100644
--- a/WebCore/loader/CachedImage.cpp
+++ b/WebCore/loader/CachedImage.cpp
@@ -28,7 +28,7 @@
 #include "Cache.h"
 #include "CachedResourceClient.h"
 #include "CachedResourceClientWalker.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Frame.h"
 #include "FrameLoaderTypes.h"
 #include "FrameView.h"
@@ -80,10 +80,10 @@ void CachedImage::decodedDataDeletionTimerFired(Timer<CachedImage>*)
     destroyDecodedData();
 }
 
-void CachedImage::load(DocLoader* docLoader)
+void CachedImage::load(CachedResourceLoader* cachedResourceLoader)
 {
-    if (!docLoader || docLoader->autoLoadImages())
-        CachedResource::load(docLoader, true, DoSecurityCheck, true);
+    if (!cachedResourceLoader || cachedResourceLoader->autoLoadImages())
+        CachedResource::load(cachedResourceLoader, true, DoSecurityCheck, true);
     else
         setLoading(false);
 }
@@ -254,7 +254,7 @@ inline void CachedImage::createImage()
 
 size_t CachedImage::maximumDecodedImageSize()
 {
-    Frame* frame = m_request ? m_request->docLoader()->frame() : 0;
+    Frame* frame = m_request ? m_request->cachedResourceLoader()->frame() : 0;
     if (!frame)
         return 0;
     Settings* settings = frame->settings();
diff --git a/WebCore/loader/CachedImage.h b/WebCore/loader/CachedImage.h
index eb55955..15f4238 100644
--- a/WebCore/loader/CachedImage.h
+++ b/WebCore/loader/CachedImage.h
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-class DocLoader;
+class CachedResourceLoader;
 class Cache;
 
 class CachedImage : public CachedResource, public ImageObserver {
@@ -42,7 +42,7 @@ public:
     CachedImage(Image*);
     virtual ~CachedImage();
     
-    virtual void load(DocLoader* docLoader);
+    virtual void load(CachedResourceLoader* cachedResourceLoader);
 
     Image* image() const;
 
diff --git a/WebCore/loader/CachedResource.cpp b/WebCore/loader/CachedResource.cpp
index 887b0b5..a6ff0ff 100644
--- a/WebCore/loader/CachedResource.cpp
+++ b/WebCore/loader/CachedResource.cpp
@@ -29,7 +29,7 @@
 #include "CachedResourceClient.h"
 #include "CachedResourceClientWalker.h"
 #include "CachedResourceHandle.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Frame.h"
 #include "FrameLoaderClient.h"
 #include "KURL.h"
@@ -78,7 +78,7 @@ CachedResource::CachedResource(const String& url, Type type)
     , m_prevInAllResourcesList(0)
     , m_nextInLiveResourcesList(0)
     , m_prevInLiveResourcesList(0)
-    , m_docLoader(0)
+    , m_cachedResourceLoader(0)
     , m_resourceToRevalidate(0)
     , m_proxyResource(0)
 {
@@ -99,14 +99,14 @@ CachedResource::~CachedResource()
     cachedResourceLeakCounter.decrement();
 #endif
 
-    if (m_docLoader)
-        m_docLoader->removeCachedResource(this);
+    if (m_cachedResourceLoader)
+        m_cachedResourceLoader->removeCachedResource(this);
 }
 
-void CachedResource::load(DocLoader* docLoader, bool incremental, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks)
+void CachedResource::load(CachedResourceLoader* cachedResourceLoader, bool incremental, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks)
 {
     m_sendResourceLoadCallbacks = sendResourceLoadCallbacks;
-    cache()->loader()->load(docLoader, this, incremental, securityCheck, sendResourceLoadCallbacks);
+    cache()->loader()->load(cachedResourceLoader, this, incremental, securityCheck, sendResourceLoadCallbacks);
     m_loading = true;
 }
 
diff --git a/WebCore/loader/CachedResource.h b/WebCore/loader/CachedResource.h
index f6eb730..958c8fd 100644
--- a/WebCore/loader/CachedResource.h
+++ b/WebCore/loader/CachedResource.h
@@ -39,7 +39,7 @@ class Cache;
 class CachedMetadata;
 class CachedResourceClient;
 class CachedResourceHandleBase;
-class DocLoader;
+class CachedResourceLoader;
 class Frame;
 class InspectorResource;
 class Request;
@@ -77,8 +77,8 @@ public:
     CachedResource(const String& url, Type);
     virtual ~CachedResource();
     
-    virtual void load(DocLoader* docLoader)  { load(docLoader, false, DoSecurityCheck, true); }
-    void load(DocLoader*, bool incremental, SecurityCheckPolicy, bool sendResourceLoadCallbacks);
+    virtual void load(CachedResourceLoader* cachedResourceLoader)  { load(cachedResourceLoader, false, DoSecurityCheck, true); }
+    void load(CachedResourceLoader*, bool incremental, SecurityCheckPolicy, bool sendResourceLoadCallbacks);
 
     virtual void setEncoding(const String&) { }
     virtual String encoding() const { return String(); }
@@ -182,7 +182,7 @@ public:
     
     virtual void destroyDecodedData() { }
 
-    void setDocLoader(DocLoader* docLoader) { m_docLoader = docLoader; }
+    void setCachedResourceLoader(CachedResourceLoader* cachedResourceLoader) { m_cachedResourceLoader = cachedResourceLoader; }
     
     bool isPreloaded() const { return m_preloadCount; }
     void increasePreloadCount() { ++m_preloadCount; }
@@ -269,7 +269,7 @@ private:
     CachedResource* m_nextInLiveResourcesList;
     CachedResource* m_prevInLiveResourcesList;
 
-    DocLoader* m_docLoader; // only non-0 for resources that are not in the cache
+    CachedResourceLoader* m_cachedResourceLoader; // only non-0 for resources that are not in the cache
     
     // If this field is non-null we are using the resource as a proxy for checking whether an existing resource is still up to date
     // using HTTP If-Modified-Since/If-None-Match headers. If the response is 304 all clients of this resource are moved
diff --git a/WebCore/loader/CachedResourceLoader.cpp b/WebCore/loader/CachedResourceLoader.cpp
new file mode 100644
index 0000000..d925eab
--- /dev/null
+++ b/WebCore/loader/CachedResourceLoader.cpp
@@ -0,0 +1,512 @@
+/*
+    Copyright (C) 1998 Lars Knoll (knoll at mpi-hd.mpg.de)
+    Copyright (C) 2001 Dirk Mueller (mueller at kde.org)
+    Copyright (C) 2002 Waldo Bastian (bastian at kde.org)
+    Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+    Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+
+    This class provides all functionality needed for loading images, style sheets and html
+    pages from the web. It has a memory cache for these objects.
+*/
+
+#include "config.h"
+#include "CachedResourceLoader.h"
+
+#include "loader.h"
+#include "Cache.h"
+#include "CachedCSSStyleSheet.h"
+#include "CachedFont.h"
+#include "CachedImage.h"
+#include "CachedScript.h"
+#include "CachedXSLStyleSheet.h"
+#include "Console.h"
+#include "Document.h"
+#include "DOMWindow.h"
+#include "HTMLElement.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "FrameLoaderClient.h"
+#include "PingLoader.h"
+#include "SecurityOrigin.h"
+#include "Settings.h"
+#include <wtf/text/CString.h>
+
+#define PRELOAD_DEBUG 0
+
+namespace WebCore {
+
+CachedResourceLoader::CachedResourceLoader(Document* doc)
+    : m_cache(cache())
+    , m_doc(doc)
+    , m_requestCount(0)
+    , m_autoLoadImages(true)
+    , m_loadInProgress(false)
+    , m_allowStaleResources(false)
+{
+    m_cache->addCachedResourceLoader(this);
+}
+
+CachedResourceLoader::~CachedResourceLoader()
+{
+    if (m_requestCount)
+        m_cache->loader()->cancelRequests(this);
+
+    clearPreloads();
+    DocumentResourceMap::iterator end = m_documentResources.end();
+    for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != end; ++it)
+        it->second->setCachedResourceLoader(0);
+    m_cache->removeCachedResourceLoader(this);
+
+    // Make sure no requests still point to this CachedResourceLoader
+    ASSERT(m_requestCount == 0);
+}
+
+Frame* CachedResourceLoader::frame() const
+{
+    return m_doc->frame();
+}
+
+void CachedResourceLoader::checkForReload(const KURL& fullURL)
+{
+    if (m_allowStaleResources)
+        return; // Don't reload resources while pasting
+
+    if (fullURL.isEmpty())
+        return;
+    
+    if (m_reloadedURLs.contains(fullURL.string()))
+        return;
+    
+    CachedResource* existing = cache()->resourceForURL(fullURL.string());
+    if (!existing || existing->isPreloaded())
+        return;
+
+    switch (cachePolicy()) {
+    case CachePolicyVerify:
+        if (!existing->mustRevalidate(CachePolicyVerify))
+            return;
+        cache()->revalidateResource(existing, this);
+        break;
+    case CachePolicyCache:
+        if (!existing->mustRevalidate(CachePolicyCache))
+            return;
+        cache()->revalidateResource(existing, this);
+        break;
+    case CachePolicyReload:
+        cache()->remove(existing);        
+        break;
+    case CachePolicyRevalidate:
+        cache()->revalidateResource(existing, this);
+        break;
+    case CachePolicyAllowStale:
+        return;
+    }
+
+    m_reloadedURLs.add(fullURL.string());
+}
+
+CachedImage* CachedResourceLoader::requestImage(const String& url)
+{
+    if (Frame* f = frame()) {
+        Settings* settings = f->settings();
+        if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
+            return 0;
+
+        if (f->loader()->pageDismissalEventBeingDispatched()) {
+            KURL completeURL = m_doc->completeURL(url);
+            if (completeURL.isValid() && canRequest(CachedResource::ImageResource, completeURL))
+                PingLoader::loadImage(f, completeURL);
+            return 0;
+        }
+    }
+    CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
+    if (autoLoadImages() && resource && resource->stillNeedsLoad()) {
+        resource->setLoading(true);
+        cache()->loader()->load(this, resource, true);
+    }
+    return resource;
+}
+
+CachedFont* CachedResourceLoader::requestFont(const String& url)
+{
+    return static_cast<CachedFont*>(requestResource(CachedResource::FontResource, url, String()));
+}
+
+CachedCSSStyleSheet* CachedResourceLoader::requestCSSStyleSheet(const String& url, const String& charset)
+{
+    return static_cast<CachedCSSStyleSheet*>(requestResource(CachedResource::CSSStyleSheet, url, charset));
+}
+
+CachedCSSStyleSheet* CachedResourceLoader::requestUserCSSStyleSheet(const String& url, const String& charset)
+{
+    return cache()->requestUserCSSStyleSheet(this, url, charset);
+}
+
+CachedScript* CachedResourceLoader::requestScript(const String& url, const String& charset)
+{
+    return static_cast<CachedScript*>(requestResource(CachedResource::Script, url, charset));
+}
+
+#if ENABLE(XSLT)
+CachedXSLStyleSheet* CachedResourceLoader::requestXSLStyleSheet(const String& url)
+{
+    return static_cast<CachedXSLStyleSheet*>(requestResource(CachedResource::XSLStyleSheet, url, String()));
+}
+#endif
+
+#if ENABLE(LINK_PREFETCH)
+CachedResource* CachedResourceLoader::requestLinkPrefetch(const String& url)
+{
+    ASSERT(frame());
+    return requestResource(CachedResource::LinkPrefetch, url, String());
+}
+#endif
+
+bool CachedResourceLoader::canRequest(CachedResource::Type type, const KURL& url)
+{
+    // Some types of resources can be loaded only from the same origin.  Other
+    // types of resources, like Images, Scripts, and CSS, can be loaded from
+    // any URL.
+    switch (type) {
+    case CachedResource::ImageResource:
+    case CachedResource::CSSStyleSheet:
+    case CachedResource::Script:
+    case CachedResource::FontResource:
+#if ENABLE(LINK_PREFETCH)
+    case CachedResource::LinkPrefetch:
+#endif
+        // These types of resources can be loaded from any origin.
+        // FIXME: Are we sure about CachedResource::FontResource?
+        break;
+#if ENABLE(XSLT)
+    case CachedResource::XSLStyleSheet:
+        if (!m_doc->securityOrigin()->canRequest(url)) {
+            printAccessDeniedMessage(url);
+            return false;
+        }
+        break;
+#endif
+    default:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+
+    // Given that the load is allowed by the same-origin policy, we should
+    // check whether the load passes the mixed-content policy.
+    //
+    // Note: Currently, we always allow mixed content, but we generate a
+    //       callback to the FrameLoaderClient in case the embedder wants to
+    //       update any security indicators.
+    // 
+    switch (type) {
+    case CachedResource::Script:
+#if ENABLE(XSLT)
+    case CachedResource::XSLStyleSheet:
+#endif
+        // These resource can inject script into the current document.
+        if (Frame* f = frame())
+            f->loader()->checkIfRunInsecureContent(m_doc->securityOrigin(), url);
+        break;
+    case CachedResource::ImageResource:
+    case CachedResource::CSSStyleSheet:
+    case CachedResource::FontResource: {
+        // These resources can corrupt only the frame's pixels.
+        if (Frame* f = frame()) {
+            Frame* top = f->tree()->top();
+            top->loader()->checkIfDisplayInsecureContent(top->document()->securityOrigin(), url);
+        }
+        break;
+    }
+#if ENABLE(LINK_PREFETCH)
+    case CachedResource::LinkPrefetch:
+        // Prefetch cannot affect the current document.
+        break;
+#endif
+    default:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+    // FIXME: Consider letting the embedder block mixed content loads.
+    return true;
+}
+
+CachedResource* CachedResourceLoader::requestResource(CachedResource::Type type, const String& url, const String& charset, bool isPreload)
+{
+    KURL fullURL = m_doc->completeURL(url);
+
+    if (!fullURL.isValid() || !canRequest(type, fullURL))
+        return 0;
+
+    if (cache()->disabled()) {
+        DocumentResourceMap::iterator it = m_documentResources.find(fullURL.string());
+        
+        if (it != m_documentResources.end()) {
+            it->second->setCachedResourceLoader(0);
+            m_documentResources.remove(it);
+        }
+    }
+
+    checkForReload(fullURL);
+
+    CachedResource* resource = cache()->requestResource(this, type, fullURL, charset, isPreload);
+    if (resource) {
+        // Check final URL of resource to catch redirects.
+        // See <https://bugs.webkit.org/show_bug.cgi?id=21963>.
+        if (fullURL != resource->url() && !canRequest(type, KURL(ParsedURLString, resource->url())))
+            return 0;
+
+        m_documentResources.set(resource->url(), resource);
+        checkCacheObjectStatus(resource);
+    }
+    return resource;
+}
+
+void CachedResourceLoader::printAccessDeniedMessage(const KURL& url) const
+{
+    if (url.isNull())
+        return;
+
+    if (!frame())
+        return;
+
+    Settings* settings = frame()->settings();
+    if (!settings || settings->privateBrowsingEnabled())
+        return;
+
+    String message = m_doc->url().isNull() ?
+        String::format("Unsafe attempt to load URL %s.",
+                       url.string().utf8().data()) :
+        String::format("Unsafe attempt to load URL %s from frame with URL %s. "
+                       "Domains, protocols and ports must match.\n",
+                       url.string().utf8().data(),
+                       m_doc->url().string().utf8().data());
+
+    // FIXME: provide a real line number and source URL.
+    frame()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, message, 1, String());
+}
+
+void CachedResourceLoader::setAutoLoadImages(bool enable)
+{
+    if (enable == m_autoLoadImages)
+        return;
+
+    m_autoLoadImages = enable;
+
+    if (!m_autoLoadImages)
+        return;
+
+    DocumentResourceMap::iterator end = m_documentResources.end();
+    for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != end; ++it) {
+        CachedResource* resource = it->second.get();
+        if (resource->type() == CachedResource::ImageResource) {
+            CachedImage* image = const_cast<CachedImage*>(static_cast<const CachedImage*>(resource));
+
+            if (image->stillNeedsLoad())
+                cache()->loader()->load(this, image, true);
+        }
+    }
+}
+
+CachePolicy CachedResourceLoader::cachePolicy() const
+{
+    return frame() ? frame()->loader()->subresourceCachePolicy() : CachePolicyVerify;
+}
+
+void CachedResourceLoader::removeCachedResource(CachedResource* resource) const
+{
+#ifndef NDEBUG
+    DocumentResourceMap::iterator it = m_documentResources.find(resource->url());
+    if (it != m_documentResources.end())
+        ASSERT(it->second.get() == resource);
+#endif
+    m_documentResources.remove(resource->url());
+}
+
+void CachedResourceLoader::setLoadInProgress(bool load)
+{
+    m_loadInProgress = load;
+    if (!load && frame())
+        frame()->loader()->loadDone();
+}
+
+void CachedResourceLoader::checkCacheObjectStatus(CachedResource* resource)
+{
+    // Return from the function for objects that we didn't load from the cache or if we don't have a frame.
+    if (!resource || !frame())
+        return;
+
+    switch (resource->status()) {
+        case CachedResource::Cached:
+            break;
+        case CachedResource::NotCached:
+        case CachedResource::Unknown:
+        case CachedResource::New:
+        case CachedResource::Pending:
+            return;
+    }
+
+    // FIXME: If the WebKit client changes or cancels the request, WebCore does not respect this and continues the load.
+    frame()->loader()->loadedResourceFromMemoryCache(resource);
+}
+
+void CachedResourceLoader::incrementRequestCount(const CachedResource* res)
+{
+    if (res->isPrefetch())
+        return;
+
+    ++m_requestCount;
+}
+
+void CachedResourceLoader::decrementRequestCount(const CachedResource* res)
+{
+    if (res->isPrefetch())
+        return;
+
+    --m_requestCount;
+    ASSERT(m_requestCount > -1);
+}
+
+int CachedResourceLoader::requestCount()
+{
+    if (loadInProgress())
+         return m_requestCount + 1;
+    return m_requestCount;
+}
+    
+void CachedResourceLoader::preload(CachedResource::Type type, const String& url, const String& charset, bool referencedFromBody)
+{
+    bool hasRendering = m_doc->body() && m_doc->body()->renderer();
+    if (!hasRendering && (referencedFromBody || type == CachedResource::ImageResource)) {
+        // Don't preload images or body resources before we have something to draw. This prevents
+        // preloads from body delaying first display when bandwidth is limited.
+        PendingPreload pendingPreload = { type, url, charset };
+        m_pendingPreloads.append(pendingPreload);
+        return;
+    }
+    requestPreload(type, url, charset);
+}
+
+void CachedResourceLoader::checkForPendingPreloads() 
+{
+    unsigned count = m_pendingPreloads.size();
+    if (!count || !m_doc->body() || !m_doc->body()->renderer())
+        return;
+    for (unsigned i = 0; i < count; ++i) {
+        PendingPreload& preload = m_pendingPreloads[i];
+        // Don't request preload if the resource already loaded normally (this will result in double load if the page is being reloaded with cached results ignored).
+        if (!cachedResource(m_doc->completeURL(preload.m_url)))
+            requestPreload(preload.m_type, preload.m_url, preload.m_charset);
+    }
+    m_pendingPreloads.clear();
+}
+
+void CachedResourceLoader::requestPreload(CachedResource::Type type, const String& url, const String& charset)
+{
+    String encoding;
+    if (type == CachedResource::Script || type == CachedResource::CSSStyleSheet)
+        encoding = charset.isEmpty() ? m_doc->frame()->loader()->writer()->encoding() : charset;
+
+    CachedResource* resource = requestResource(type, url, encoding, true);
+    if (!resource || (m_preloads && m_preloads->contains(resource)))
+        return;
+    resource->increasePreloadCount();
+
+    if (!m_preloads)
+        m_preloads = adoptPtr(new ListHashSet<CachedResource*>);
+    m_preloads->add(resource);
+
+#if PRELOAD_DEBUG
+    printf("PRELOADING %s\n",  resource->url().latin1().data());
+#endif
+}
+
+void CachedResourceLoader::clearPreloads()
+{
+#if PRELOAD_DEBUG
+    printPreloadStats();
+#endif
+    if (!m_preloads)
+        return;
+
+    ListHashSet<CachedResource*>::iterator end = m_preloads->end();
+    for (ListHashSet<CachedResource*>::iterator it = m_preloads->begin(); it != end; ++it) {
+        CachedResource* res = *it;
+        res->decreasePreloadCount();
+        if (res->canDelete() && !res->inCache())
+            delete res;
+        else if (res->preloadResult() == CachedResource::PreloadNotReferenced)
+            cache()->remove(res);
+    }
+    m_preloads.clear();
+}
+
+void CachedResourceLoader::clearPendingPreloads()
+{
+    m_pendingPreloads.clear();
+}
+
+#if PRELOAD_DEBUG
+void CachedResourceLoader::printPreloadStats()
+{
+    unsigned scripts = 0;
+    unsigned scriptMisses = 0;
+    unsigned stylesheets = 0;
+    unsigned stylesheetMisses = 0;
+    unsigned images = 0;
+    unsigned imageMisses = 0;
+    ListHashSet<CachedResource*>::iterator end = m_preloads.end();
+    for (ListHashSet<CachedResource*>::iterator it = m_preloads.begin(); it != end; ++it) {
+        CachedResource* res = *it;
+        if (res->preloadResult() == CachedResource::PreloadNotReferenced)
+            printf("!! UNREFERENCED PRELOAD %s\n", res->url().latin1().data());
+        else if (res->preloadResult() == CachedResource::PreloadReferencedWhileComplete)
+            printf("HIT COMPLETE PRELOAD %s\n", res->url().latin1().data());
+        else if (res->preloadResult() == CachedResource::PreloadReferencedWhileLoading)
+            printf("HIT LOADING PRELOAD %s\n", res->url().latin1().data());
+        
+        if (res->type() == CachedResource::Script) {
+            scripts++;
+            if (res->preloadResult() < CachedResource::PreloadReferencedWhileLoading)
+                scriptMisses++;
+        } else if (res->type() == CachedResource::CSSStyleSheet) {
+            stylesheets++;
+            if (res->preloadResult() < CachedResource::PreloadReferencedWhileLoading)
+                stylesheetMisses++;
+        } else {
+            images++;
+            if (res->preloadResult() < CachedResource::PreloadReferencedWhileLoading)
+                imageMisses++;
+        }
+        
+        if (res->errorOccurred())
+            cache()->remove(res);
+        
+        res->decreasePreloadCount();
+    }
+    m_preloads.clear();
+    
+    if (scripts)
+        printf("SCRIPTS: %d (%d hits, hit rate %d%%)\n", scripts, scripts - scriptMisses, (scripts - scriptMisses) * 100 / scripts);
+    if (stylesheets)
+        printf("STYLESHEETS: %d (%d hits, hit rate %d%%)\n", stylesheets, stylesheets - stylesheetMisses, (stylesheets - stylesheetMisses) * 100 / stylesheets);
+    if (images)
+        printf("IMAGES:  %d (%d hits, hit rate %d%%)\n", images, images - imageMisses, (images - imageMisses) * 100 / images);
+}
+#endif
+    
+}
diff --git a/WebCore/loader/CachedResourceLoader.h b/WebCore/loader/CachedResourceLoader.h
new file mode 100644
index 0000000..02e983b
--- /dev/null
+++ b/WebCore/loader/CachedResourceLoader.h
@@ -0,0 +1,135 @@
+/*
+    Copyright (C) 1998 Lars Knoll (knoll at mpi-hd.mpg.de)
+    Copyright (C) 2001 Dirk Mueller <mueller at kde.org>
+    Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
+    Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+
+    This class provides all functionality needed for loading images, style sheets and html
+    pages from the web. It has a memory cache for these objects.
+*/
+
+#ifndef CachedResourceLoader_h
+#define CachedResourceLoader_h
+
+#include "CachedResource.h"
+#include "CachedResourceHandle.h"
+#include "CachePolicy.h"
+#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
+#include <wtf/ListHashSet.h>
+#include <wtf/text/StringHash.h>
+
+namespace WebCore {
+
+class CachedCSSStyleSheet;
+class CachedFont;
+class CachedImage;
+class CachedScript;
+class CachedXSLStyleSheet;
+class Document;
+class Frame;
+class ImageLoader;
+class KURL;
+
+// The CachedResourceLoader manages the loading of scripts/images/stylesheets for a single document.
+class CachedResourceLoader : public Noncopyable {
+friend class Cache;
+friend class ImageLoader;
+
+public:
+    CachedResourceLoader(Document*);
+    ~CachedResourceLoader();
+
+    CachedImage* requestImage(const String& url);
+    CachedCSSStyleSheet* requestCSSStyleSheet(const String& url, const String& charset);
+    CachedCSSStyleSheet* requestUserCSSStyleSheet(const String& url, const String& charset);
+    CachedScript* requestScript(const String& url, const String& charset);
+    CachedFont* requestFont(const String& url);
+
+#if ENABLE(XSLT)
+    CachedXSLStyleSheet* requestXSLStyleSheet(const String& url);
+#endif
+#if ENABLE(LINK_PREFETCH)
+    CachedResource* requestLinkPrefetch(const String &url);
+#endif
+
+    // Logs an access denied message to the console for the specified URL.
+    void printAccessDeniedMessage(const KURL& url) const;
+
+    CachedResource* cachedResource(const String& url) const { return m_documentResources.get(url).get(); }
+    
+    typedef HashMap<String, CachedResourceHandle<CachedResource> > DocumentResourceMap;
+    const DocumentResourceMap& allCachedResources() const { return m_documentResources; }
+
+    bool autoLoadImages() const { return m_autoLoadImages; }
+    void setAutoLoadImages(bool);
+    
+    CachePolicy cachePolicy() const;
+    
+    Frame* frame() const; // Can be NULL
+    Document* doc() const { return m_doc; }
+
+    void removeCachedResource(CachedResource*) const;
+
+    void setLoadInProgress(bool);
+    bool loadInProgress() const { return m_loadInProgress; }
+    
+    void setAllowStaleResources(bool allowStaleResources) { m_allowStaleResources = allowStaleResources; }
+
+    void incrementRequestCount(const CachedResource*);
+    void decrementRequestCount(const CachedResource*);
+    int requestCount();
+    
+    void clearPreloads();
+    void clearPendingPreloads();
+    void preload(CachedResource::Type, const String& url, const String& charset, bool referencedFromBody);
+    void checkForPendingPreloads();
+    void printPreloadStats();
+    
+private:
+    CachedResource* requestResource(CachedResource::Type, const String& url, const String& charset, bool isPreload = false);
+    void requestPreload(CachedResource::Type, const String& url, const String& charset);
+
+    void checkForReload(const KURL&);
+    void checkCacheObjectStatus(CachedResource*);
+    bool canRequest(CachedResource::Type, const KURL&);
+    
+    Cache* m_cache;
+    HashSet<String> m_reloadedURLs;
+    mutable DocumentResourceMap m_documentResources;
+    Document* m_doc;
+    
+    int m_requestCount;
+    
+    OwnPtr<ListHashSet<CachedResource*> > m_preloads;
+    struct PendingPreload {
+        CachedResource::Type m_type;
+        String m_url;
+        String m_charset;
+    };
+    Vector<PendingPreload> m_pendingPreloads;
+    
+    //29 bits left
+    bool m_autoLoadImages : 1;
+    bool m_loadInProgress : 1;
+    bool m_allowStaleResources : 1;
+};
+
+}
+
+#endif
diff --git a/WebCore/loader/CachedScript.h b/WebCore/loader/CachedScript.h
index beab508..1bc4e8c 100644
--- a/WebCore/loader/CachedScript.h
+++ b/WebCore/loader/CachedScript.h
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-    class DocLoader;
+    class CachedResourceLoader;
     class TextResourceDecoder;
 
     class CachedScript : public CachedResource {
diff --git a/WebCore/loader/CachedXSLStyleSheet.h b/WebCore/loader/CachedXSLStyleSheet.h
index a0b5477..8587b0b 100644
--- a/WebCore/loader/CachedXSLStyleSheet.h
+++ b/WebCore/loader/CachedXSLStyleSheet.h
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-    class DocLoader;
+    class CachedResourceLoader;
     class TextResourceDecoder;
 
 #if ENABLE(XSLT)
diff --git a/WebCore/loader/DocLoader.cpp b/WebCore/loader/DocLoader.cpp
deleted file mode 100644
index 11268f5..0000000
--- a/WebCore/loader/DocLoader.cpp
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
-    Copyright (C) 1998 Lars Knoll (knoll at mpi-hd.mpg.de)
-    Copyright (C) 2001 Dirk Mueller (mueller at kde.org)
-    Copyright (C) 2002 Waldo Bastian (bastian at kde.org)
-    Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
-    Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-
-    This class provides all functionality needed for loading images, style sheets and html
-    pages from the web. It has a memory cache for these objects.
-*/
-
-#include "config.h"
-#include "DocLoader.h"
-
-#include "loader.h"
-#include "Cache.h"
-#include "CachedCSSStyleSheet.h"
-#include "CachedFont.h"
-#include "CachedImage.h"
-#include "CachedScript.h"
-#include "CachedXSLStyleSheet.h"
-#include "Console.h"
-#include "Document.h"
-#include "DOMWindow.h"
-#include "HTMLElement.h"
-#include "Frame.h"
-#include "FrameLoader.h"
-#include "FrameLoaderClient.h"
-#include "PingLoader.h"
-#include "SecurityOrigin.h"
-#include "Settings.h"
-#include <wtf/text/CString.h>
-
-#define PRELOAD_DEBUG 0
-
-namespace WebCore {
-
-DocLoader::DocLoader(Document* doc)
-    : m_cache(cache())
-    , m_doc(doc)
-    , m_requestCount(0)
-    , m_autoLoadImages(true)
-    , m_loadInProgress(false)
-    , m_allowStaleResources(false)
-{
-    m_cache->addDocLoader(this);
-}
-
-DocLoader::~DocLoader()
-{
-    if (m_requestCount)
-        m_cache->loader()->cancelRequests(this);
-
-    clearPreloads();
-    DocumentResourceMap::iterator end = m_documentResources.end();
-    for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != end; ++it)
-        it->second->setDocLoader(0);
-    m_cache->removeDocLoader(this);
-
-    // Make sure no requests still point to this DocLoader
-    ASSERT(m_requestCount == 0);
-}
-
-Frame* DocLoader::frame() const
-{
-    return m_doc->frame();
-}
-
-void DocLoader::checkForReload(const KURL& fullURL)
-{
-    if (m_allowStaleResources)
-        return; // Don't reload resources while pasting
-
-    if (fullURL.isEmpty())
-        return;
-    
-    if (m_reloadedURLs.contains(fullURL.string()))
-        return;
-    
-    CachedResource* existing = cache()->resourceForURL(fullURL.string());
-    if (!existing || existing->isPreloaded())
-        return;
-
-    switch (cachePolicy()) {
-    case CachePolicyVerify:
-        if (!existing->mustRevalidate(CachePolicyVerify))
-            return;
-        cache()->revalidateResource(existing, this);
-        break;
-    case CachePolicyCache:
-        if (!existing->mustRevalidate(CachePolicyCache))
-            return;
-        cache()->revalidateResource(existing, this);
-        break;
-    case CachePolicyReload:
-        cache()->remove(existing);        
-        break;
-    case CachePolicyRevalidate:
-        cache()->revalidateResource(existing, this);
-        break;
-    case CachePolicyAllowStale:
-        return;
-    }
-
-    m_reloadedURLs.add(fullURL.string());
-}
-
-CachedImage* DocLoader::requestImage(const String& url)
-{
-    if (Frame* f = frame()) {
-        Settings* settings = f->settings();
-        if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
-            return 0;
-
-        if (f->loader()->pageDismissalEventBeingDispatched()) {
-            KURL completeURL = m_doc->completeURL(url);
-            if (completeURL.isValid() && canRequest(CachedResource::ImageResource, completeURL))
-                PingLoader::loadImage(f, completeURL);
-            return 0;
-        }
-    }
-    CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
-    if (autoLoadImages() && resource && resource->stillNeedsLoad()) {
-        resource->setLoading(true);
-        cache()->loader()->load(this, resource, true);
-    }
-    return resource;
-}
-
-CachedFont* DocLoader::requestFont(const String& url)
-{
-    return static_cast<CachedFont*>(requestResource(CachedResource::FontResource, url, String()));
-}
-
-CachedCSSStyleSheet* DocLoader::requestCSSStyleSheet(const String& url, const String& charset)
-{
-    return static_cast<CachedCSSStyleSheet*>(requestResource(CachedResource::CSSStyleSheet, url, charset));
-}
-
-CachedCSSStyleSheet* DocLoader::requestUserCSSStyleSheet(const String& url, const String& charset)
-{
-    return cache()->requestUserCSSStyleSheet(this, url, charset);
-}
-
-CachedScript* DocLoader::requestScript(const String& url, const String& charset)
-{
-    return static_cast<CachedScript*>(requestResource(CachedResource::Script, url, charset));
-}
-
-#if ENABLE(XSLT)
-CachedXSLStyleSheet* DocLoader::requestXSLStyleSheet(const String& url)
-{
-    return static_cast<CachedXSLStyleSheet*>(requestResource(CachedResource::XSLStyleSheet, url, String()));
-}
-#endif
-
-#if ENABLE(LINK_PREFETCH)
-CachedResource* DocLoader::requestLinkPrefetch(const String& url)
-{
-    ASSERT(frame());
-    return requestResource(CachedResource::LinkPrefetch, url, String());
-}
-#endif
-
-bool DocLoader::canRequest(CachedResource::Type type, const KURL& url)
-{
-    // Some types of resources can be loaded only from the same origin.  Other
-    // types of resources, like Images, Scripts, and CSS, can be loaded from
-    // any URL.
-    switch (type) {
-    case CachedResource::ImageResource:
-    case CachedResource::CSSStyleSheet:
-    case CachedResource::Script:
-    case CachedResource::FontResource:
-#if ENABLE(LINK_PREFETCH)
-    case CachedResource::LinkPrefetch:
-#endif
-        // These types of resources can be loaded from any origin.
-        // FIXME: Are we sure about CachedResource::FontResource?
-        break;
-#if ENABLE(XSLT)
-    case CachedResource::XSLStyleSheet:
-        if (!m_doc->securityOrigin()->canRequest(url)) {
-            printAccessDeniedMessage(url);
-            return false;
-        }
-        break;
-#endif
-    default:
-        ASSERT_NOT_REACHED();
-        break;
-    }
-
-    // Given that the load is allowed by the same-origin policy, we should
-    // check whether the load passes the mixed-content policy.
-    //
-    // Note: Currently, we always allow mixed content, but we generate a
-    //       callback to the FrameLoaderClient in case the embedder wants to
-    //       update any security indicators.
-    // 
-    switch (type) {
-    case CachedResource::Script:
-#if ENABLE(XSLT)
-    case CachedResource::XSLStyleSheet:
-#endif
-        // These resource can inject script into the current document.
-        if (Frame* f = frame())
-            f->loader()->checkIfRunInsecureContent(m_doc->securityOrigin(), url);
-        break;
-    case CachedResource::ImageResource:
-    case CachedResource::CSSStyleSheet:
-    case CachedResource::FontResource: {
-        // These resources can corrupt only the frame's pixels.
-        if (Frame* f = frame()) {
-            Frame* top = f->tree()->top();
-            top->loader()->checkIfDisplayInsecureContent(top->document()->securityOrigin(), url);
-        }
-        break;
-    }
-#if ENABLE(LINK_PREFETCH)
-    case CachedResource::LinkPrefetch:
-        // Prefetch cannot affect the current document.
-        break;
-#endif
-    default:
-        ASSERT_NOT_REACHED();
-        break;
-    }
-    // FIXME: Consider letting the embedder block mixed content loads.
-    return true;
-}
-
-CachedResource* DocLoader::requestResource(CachedResource::Type type, const String& url, const String& charset, bool isPreload)
-{
-    KURL fullURL = m_doc->completeURL(url);
-
-    if (!fullURL.isValid() || !canRequest(type, fullURL))
-        return 0;
-
-    if (cache()->disabled()) {
-        DocumentResourceMap::iterator it = m_documentResources.find(fullURL.string());
-        
-        if (it != m_documentResources.end()) {
-            it->second->setDocLoader(0);
-            m_documentResources.remove(it);
-        }
-    }
-
-    checkForReload(fullURL);
-
-    CachedResource* resource = cache()->requestResource(this, type, fullURL, charset, isPreload);
-    if (resource) {
-        // Check final URL of resource to catch redirects.
-        // See <https://bugs.webkit.org/show_bug.cgi?id=21963>.
-        if (fullURL != resource->url() && !canRequest(type, KURL(ParsedURLString, resource->url())))
-            return 0;
-
-        m_documentResources.set(resource->url(), resource);
-        checkCacheObjectStatus(resource);
-    }
-    return resource;
-}
-
-void DocLoader::printAccessDeniedMessage(const KURL& url) const
-{
-    if (url.isNull())
-        return;
-
-    if (!frame())
-        return;
-
-    Settings* settings = frame()->settings();
-    if (!settings || settings->privateBrowsingEnabled())
-        return;
-
-    String message = m_doc->url().isNull() ?
-        String::format("Unsafe attempt to load URL %s.",
-                       url.string().utf8().data()) :
-        String::format("Unsafe attempt to load URL %s from frame with URL %s. "
-                       "Domains, protocols and ports must match.\n",
-                       url.string().utf8().data(),
-                       m_doc->url().string().utf8().data());
-
-    // FIXME: provide a real line number and source URL.
-    frame()->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, message, 1, String());
-}
-
-void DocLoader::setAutoLoadImages(bool enable)
-{
-    if (enable == m_autoLoadImages)
-        return;
-
-    m_autoLoadImages = enable;
-
-    if (!m_autoLoadImages)
-        return;
-
-    DocumentResourceMap::iterator end = m_documentResources.end();
-    for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != end; ++it) {
-        CachedResource* resource = it->second.get();
-        if (resource->type() == CachedResource::ImageResource) {
-            CachedImage* image = const_cast<CachedImage*>(static_cast<const CachedImage*>(resource));
-
-            if (image->stillNeedsLoad())
-                cache()->loader()->load(this, image, true);
-        }
-    }
-}
-
-CachePolicy DocLoader::cachePolicy() const
-{
-    return frame() ? frame()->loader()->subresourceCachePolicy() : CachePolicyVerify;
-}
-
-void DocLoader::removeCachedResource(CachedResource* resource) const
-{
-#ifndef NDEBUG
-    DocumentResourceMap::iterator it = m_documentResources.find(resource->url());
-    if (it != m_documentResources.end())
-        ASSERT(it->second.get() == resource);
-#endif
-    m_documentResources.remove(resource->url());
-}
-
-void DocLoader::setLoadInProgress(bool load)
-{
-    m_loadInProgress = load;
-    if (!load && frame())
-        frame()->loader()->loadDone();
-}
-
-void DocLoader::checkCacheObjectStatus(CachedResource* resource)
-{
-    // Return from the function for objects that we didn't load from the cache or if we don't have a frame.
-    if (!resource || !frame())
-        return;
-
-    switch (resource->status()) {
-        case CachedResource::Cached:
-            break;
-        case CachedResource::NotCached:
-        case CachedResource::Unknown:
-        case CachedResource::New:
-        case CachedResource::Pending:
-            return;
-    }
-
-    // FIXME: If the WebKit client changes or cancels the request, WebCore does not respect this and continues the load.
-    frame()->loader()->loadedResourceFromMemoryCache(resource);
-}
-
-void DocLoader::incrementRequestCount(const CachedResource* res)
-{
-    if (res->isPrefetch())
-        return;
-
-    ++m_requestCount;
-}
-
-void DocLoader::decrementRequestCount(const CachedResource* res)
-{
-    if (res->isPrefetch())
-        return;
-
-    --m_requestCount;
-    ASSERT(m_requestCount > -1);
-}
-
-int DocLoader::requestCount()
-{
-    if (loadInProgress())
-         return m_requestCount + 1;
-    return m_requestCount;
-}
-    
-void DocLoader::preload(CachedResource::Type type, const String& url, const String& charset, bool referencedFromBody)
-{
-    bool hasRendering = m_doc->body() && m_doc->body()->renderer();
-    if (!hasRendering && (referencedFromBody || type == CachedResource::ImageResource)) {
-        // Don't preload images or body resources before we have something to draw. This prevents
-        // preloads from body delaying first display when bandwidth is limited.
-        PendingPreload pendingPreload = { type, url, charset };
-        m_pendingPreloads.append(pendingPreload);
-        return;
-    }
-    requestPreload(type, url, charset);
-}
-
-void DocLoader::checkForPendingPreloads() 
-{
-    unsigned count = m_pendingPreloads.size();
-    if (!count || !m_doc->body() || !m_doc->body()->renderer())
-        return;
-    for (unsigned i = 0; i < count; ++i) {
-        PendingPreload& preload = m_pendingPreloads[i];
-        // Don't request preload if the resource already loaded normally (this will result in double load if the page is being reloaded with cached results ignored).
-        if (!cachedResource(m_doc->completeURL(preload.m_url)))
-            requestPreload(preload.m_type, preload.m_url, preload.m_charset);
-    }
-    m_pendingPreloads.clear();
-}
-
-void DocLoader::requestPreload(CachedResource::Type type, const String& url, const String& charset)
-{
-    String encoding;
-    if (type == CachedResource::Script || type == CachedResource::CSSStyleSheet)
-        encoding = charset.isEmpty() ? m_doc->frame()->loader()->writer()->encoding() : charset;
-
-    CachedResource* resource = requestResource(type, url, encoding, true);
-    if (!resource || (m_preloads && m_preloads->contains(resource)))
-        return;
-    resource->increasePreloadCount();
-
-    if (!m_preloads)
-        m_preloads = adoptPtr(new ListHashSet<CachedResource*>);
-    m_preloads->add(resource);
-
-#if PRELOAD_DEBUG
-    printf("PRELOADING %s\n",  resource->url().latin1().data());
-#endif
-}
-
-void DocLoader::clearPreloads()
-{
-#if PRELOAD_DEBUG
-    printPreloadStats();
-#endif
-    if (!m_preloads)
-        return;
-
-    ListHashSet<CachedResource*>::iterator end = m_preloads->end();
-    for (ListHashSet<CachedResource*>::iterator it = m_preloads->begin(); it != end; ++it) {
-        CachedResource* res = *it;
-        res->decreasePreloadCount();
-        if (res->canDelete() && !res->inCache())
-            delete res;
-        else if (res->preloadResult() == CachedResource::PreloadNotReferenced)
-            cache()->remove(res);
-    }
-    m_preloads.clear();
-}
-
-void DocLoader::clearPendingPreloads()
-{
-    m_pendingPreloads.clear();
-}
-
-#if PRELOAD_DEBUG
-void DocLoader::printPreloadStats()
-{
-    unsigned scripts = 0;
-    unsigned scriptMisses = 0;
-    unsigned stylesheets = 0;
-    unsigned stylesheetMisses = 0;
-    unsigned images = 0;
-    unsigned imageMisses = 0;
-    ListHashSet<CachedResource*>::iterator end = m_preloads.end();
-    for (ListHashSet<CachedResource*>::iterator it = m_preloads.begin(); it != end; ++it) {
-        CachedResource* res = *it;
-        if (res->preloadResult() == CachedResource::PreloadNotReferenced)
-            printf("!! UNREFERENCED PRELOAD %s\n", res->url().latin1().data());
-        else if (res->preloadResult() == CachedResource::PreloadReferencedWhileComplete)
-            printf("HIT COMPLETE PRELOAD %s\n", res->url().latin1().data());
-        else if (res->preloadResult() == CachedResource::PreloadReferencedWhileLoading)
-            printf("HIT LOADING PRELOAD %s\n", res->url().latin1().data());
-        
-        if (res->type() == CachedResource::Script) {
-            scripts++;
-            if (res->preloadResult() < CachedResource::PreloadReferencedWhileLoading)
-                scriptMisses++;
-        } else if (res->type() == CachedResource::CSSStyleSheet) {
-            stylesheets++;
-            if (res->preloadResult() < CachedResource::PreloadReferencedWhileLoading)
-                stylesheetMisses++;
-        } else {
-            images++;
-            if (res->preloadResult() < CachedResource::PreloadReferencedWhileLoading)
-                imageMisses++;
-        }
-        
-        if (res->errorOccurred())
-            cache()->remove(res);
-        
-        res->decreasePreloadCount();
-    }
-    m_preloads.clear();
-    
-    if (scripts)
-        printf("SCRIPTS: %d (%d hits, hit rate %d%%)\n", scripts, scripts - scriptMisses, (scripts - scriptMisses) * 100 / scripts);
-    if (stylesheets)
-        printf("STYLESHEETS: %d (%d hits, hit rate %d%%)\n", stylesheets, stylesheets - stylesheetMisses, (stylesheets - stylesheetMisses) * 100 / stylesheets);
-    if (images)
-        printf("IMAGES:  %d (%d hits, hit rate %d%%)\n", images, images - imageMisses, (images - imageMisses) * 100 / images);
-}
-#endif
-    
-}
diff --git a/WebCore/loader/DocLoader.h b/WebCore/loader/DocLoader.h
deleted file mode 100644
index 05ccaac..0000000
--- a/WebCore/loader/DocLoader.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-    Copyright (C) 1998 Lars Knoll (knoll at mpi-hd.mpg.de)
-    Copyright (C) 2001 Dirk Mueller <mueller at kde.org>
-    Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
-    Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-
-    This class provides all functionality needed for loading images, style sheets and html
-    pages from the web. It has a memory cache for these objects.
-*/
-
-#ifndef DocLoader_h
-#define DocLoader_h
-
-#include "CachedResource.h"
-#include "CachedResourceHandle.h"
-#include "CachePolicy.h"
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/ListHashSet.h>
-#include <wtf/text/StringHash.h>
-
-namespace WebCore {
-
-class CachedCSSStyleSheet;
-class CachedFont;
-class CachedImage;
-class CachedScript;
-class CachedXSLStyleSheet;
-class Document;
-class Frame;
-class ImageLoader;
-class KURL;
-
-// The DocLoader manages the loading of scripts/images/stylesheets for a single document.
-class DocLoader : public Noncopyable {
-friend class Cache;
-friend class ImageLoader;
-
-public:
-    DocLoader(Document*);
-    ~DocLoader();
-
-    CachedImage* requestImage(const String& url);
-    CachedCSSStyleSheet* requestCSSStyleSheet(const String& url, const String& charset);
-    CachedCSSStyleSheet* requestUserCSSStyleSheet(const String& url, const String& charset);
-    CachedScript* requestScript(const String& url, const String& charset);
-    CachedFont* requestFont(const String& url);
-
-#if ENABLE(XSLT)
-    CachedXSLStyleSheet* requestXSLStyleSheet(const String& url);
-#endif
-#if ENABLE(LINK_PREFETCH)
-    CachedResource* requestLinkPrefetch(const String &url);
-#endif
-
-    // Logs an access denied message to the console for the specified URL.
-    void printAccessDeniedMessage(const KURL& url) const;
-
-    CachedResource* cachedResource(const String& url) const { return m_documentResources.get(url).get(); }
-    
-    typedef HashMap<String, CachedResourceHandle<CachedResource> > DocumentResourceMap;
-    const DocumentResourceMap& allCachedResources() const { return m_documentResources; }
-
-    bool autoLoadImages() const { return m_autoLoadImages; }
-    void setAutoLoadImages(bool);
-    
-    CachePolicy cachePolicy() const;
-    
-    Frame* frame() const; // Can be NULL
-    Document* doc() const { return m_doc; }
-
-    void removeCachedResource(CachedResource*) const;
-
-    void setLoadInProgress(bool);
-    bool loadInProgress() const { return m_loadInProgress; }
-    
-    void setAllowStaleResources(bool allowStaleResources) { m_allowStaleResources = allowStaleResources; }
-
-    void incrementRequestCount(const CachedResource*);
-    void decrementRequestCount(const CachedResource*);
-    int requestCount();
-    
-    void clearPreloads();
-    void clearPendingPreloads();
-    void preload(CachedResource::Type, const String& url, const String& charset, bool referencedFromBody);
-    void checkForPendingPreloads();
-    void printPreloadStats();
-    
-private:
-    CachedResource* requestResource(CachedResource::Type, const String& url, const String& charset, bool isPreload = false);
-    void requestPreload(CachedResource::Type, const String& url, const String& charset);
-
-    void checkForReload(const KURL&);
-    void checkCacheObjectStatus(CachedResource*);
-    bool canRequest(CachedResource::Type, const KURL&);
-    
-    Cache* m_cache;
-    HashSet<String> m_reloadedURLs;
-    mutable DocumentResourceMap m_documentResources;
-    Document* m_doc;
-    
-    int m_requestCount;
-    
-    OwnPtr<ListHashSet<CachedResource*> > m_preloads;
-    struct PendingPreload {
-        CachedResource::Type m_type;
-        String m_url;
-        String m_charset;
-    };
-    Vector<PendingPreload> m_pendingPreloads;
-    
-    //29 bits left
-    bool m_autoLoadImages : 1;
-    bool m_loadInProgress : 1;
-    bool m_allowStaleResources : 1;
-};
-
-}
-
-#endif
diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp
index cdc711c..914d848 100644
--- a/WebCore/loader/DocumentLoader.cpp
+++ b/WebCore/loader/DocumentLoader.cpp
@@ -33,7 +33,7 @@
 #include "ArchiveFactory.h"
 #include "ArchiveResourceCollection.h"
 #include "CachedPage.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "DocumentParser.h"
 #include "Event.h"
@@ -392,7 +392,7 @@ bool DocumentLoader::isLoadingInAPISense() const
         if (!m_subresourceLoaders.isEmpty())
             return true;
         Document* doc = m_frame->document();
-        if (doc->docLoader()->requestCount())
+        if (doc->cachedResourceLoader()->requestCount())
             return true;
         if (DocumentParser* parser = doc->parser())
             if (parser->processingData())
@@ -473,7 +473,7 @@ PassRefPtr<ArchiveResource> DocumentLoader::subresource(const KURL& url) const
     if (!isCommitted())
         return 0;
     
-    CachedResource* resource = m_frame->document()->docLoader()->cachedResource(url);
+    CachedResource* resource = m_frame->document()->cachedResourceLoader()->cachedResource(url);
     if (!resource || !resource->isLoaded())
         return archiveResourceForURL(url);
 
@@ -496,9 +496,9 @@ void DocumentLoader::getSubresources(Vector<PassRefPtr<ArchiveResource> >& subre
 
     Document* document = m_frame->document();
 
-    const DocLoader::DocumentResourceMap& allResources = document->docLoader()->allCachedResources();
-    DocLoader::DocumentResourceMap::const_iterator end = allResources.end();
-    for (DocLoader::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it) {
+    const CachedResourceLoader::DocumentResourceMap& allResources = document->cachedResourceLoader()->allCachedResources();
+    CachedResourceLoader::DocumentResourceMap::const_iterator end = allResources.end();
+    for (CachedResourceLoader::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it) {
         RefPtr<ArchiveResource> subresource = this->subresource(KURL(ParsedURLString, it->second->url()));
         if (subresource)
             subresources.append(subresource.release());
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index dc7a1ce..45d3180 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -43,7 +43,7 @@
 #include "Chrome.h"
 #include "DOMImplementation.h"
 #include "DOMWindow.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "DocumentLoadTiming.h"
 #include "DocumentLoader.h"
@@ -157,7 +157,7 @@ static int numRequests(Document* document)
     if (!document)
         return 0;
     
-    return document->docLoader()->requestCount();
+    return document->cachedResourceLoader()->requestCount();
 }
 
 // This is not in the FrameLoader class to emphasize that it does not depend on
@@ -429,8 +429,8 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolic
         // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10537
         doc->setReadyState(Document::Complete);
 
-        if (DocLoader* docLoader = doc->docLoader())
-            cache()->loader()->cancelRequests(docLoader);
+        if (CachedResourceLoader* cachedResourceLoader = doc->cachedResourceLoader())
+            cache()->loader()->cancelRequests(cachedResourceLoader);
 
 #if ENABLE(DATABASE)
         if (databasePolicy == DatabasePolicyStop)
@@ -669,7 +669,7 @@ void FrameLoader::didBeginDocument(bool dispatch)
     updateFirstPartyForCookies();
 
     Settings* settings = m_frame->document()->settings();
-    m_frame->document()->docLoader()->setAutoLoadImages(settings && settings->loadsImagesAutomatically());
+    m_frame->document()->cachedResourceLoader()->setAutoLoadImages(settings && settings->loadsImagesAutomatically());
 
     if (m_documentLoader) {
         String dnsPrefetchControl = m_documentLoader->response().httpHeaderField("X-DNS-Prefetch-Control");
diff --git a/WebCore/loader/HistoryController.cpp b/WebCore/loader/HistoryController.cpp
index 32a6a91..f06589e 100644
--- a/WebCore/loader/HistoryController.cpp
+++ b/WebCore/loader/HistoryController.cpp
@@ -450,9 +450,9 @@ void HistoryController::setProvisionalItem(HistoryItem* item)
 
 PassRefPtr<HistoryItem> HistoryController::createItem(bool useOriginal)
 {
-    DocumentLoader* docLoader = m_frame->loader()->documentLoader();
+    DocumentLoader* documentLoader = m_frame->loader()->documentLoader();
     
-    KURL unreachableURL = docLoader ? docLoader->unreachableURL() : KURL();
+    KURL unreachableURL = documentLoader ? documentLoader->unreachableURL() : KURL();
     
     KURL url;
     KURL originalURL;
@@ -461,11 +461,11 @@ PassRefPtr<HistoryItem> HistoryController::createItem(bool useOriginal)
         url = unreachableURL;
         originalURL = unreachableURL;
     } else {
-        originalURL = docLoader ? docLoader->originalURL() : KURL();
+        originalURL = documentLoader ? documentLoader->originalURL() : KURL();
         if (useOriginal)
             url = originalURL;
-        else if (docLoader)
-            url = docLoader->requestURL();
+        else if (documentLoader)
+            url = documentLoader->requestURL();
     }
 
     LOG(History, "WebCoreHistory: Creating item for %s", url.string().ascii().data());
@@ -482,20 +482,20 @@ PassRefPtr<HistoryItem> HistoryController::createItem(bool useOriginal)
     
     Frame* parentFrame = m_frame->tree()->parent();
     String parent = parentFrame ? parentFrame->tree()->name() : "";
-    String title = docLoader ? docLoader->title() : "";
+    String title = documentLoader ? documentLoader->title() : "";
 
     RefPtr<HistoryItem> item = HistoryItem::create(url, m_frame->tree()->name(), parent, title);
     item->setOriginalURLString(originalURL.string());
 
-    if (!unreachableURL.isEmpty() || !docLoader || docLoader->response().httpStatusCode() >= 400)
+    if (!unreachableURL.isEmpty() || !documentLoader || documentLoader->response().httpStatusCode() >= 400)
         item->setLastVisitWasFailure(true);
 
     // Save form state if this is a POST
-    if (docLoader) {
+    if (documentLoader) {
         if (useOriginal)
-            item->setFormInfoFromRequest(docLoader->originalRequest());
+            item->setFormInfoFromRequest(documentLoader->originalRequest());
         else
-            item->setFormInfoFromRequest(docLoader->request());
+            item->setFormInfoFromRequest(documentLoader->request());
     }
     
     // Set the item for which we will save document state
diff --git a/WebCore/loader/ImageLoader.cpp b/WebCore/loader/ImageLoader.cpp
index 242bf94..f6bc8d0 100644
--- a/WebCore/loader/ImageLoader.cpp
+++ b/WebCore/loader/ImageLoader.cpp
@@ -24,7 +24,7 @@
 
 #include "CSSHelper.h"
 #include "CachedImage.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "Element.h"
 #include "HTMLNames.h"
@@ -161,15 +161,15 @@ void ImageLoader::updateFromElement()
     CachedImage* newImage = 0;
     if (!(attr.isNull() || (attr.isEmpty() && document->baseURI().isLocalFile()))) {
         if (m_loadManually) {
-            bool autoLoadOtherImages = document->docLoader()->autoLoadImages();
-            document->docLoader()->setAutoLoadImages(false);
+            bool autoLoadOtherImages = document->cachedResourceLoader()->autoLoadImages();
+            document->cachedResourceLoader()->setAutoLoadImages(false);
             newImage = new CachedImage(sourceURI(attr));
             newImage->setLoading(true);
-            newImage->setDocLoader(document->docLoader());
-            document->docLoader()->m_documentResources.set(newImage->url(), newImage);
-            document->docLoader()->setAutoLoadImages(autoLoadOtherImages);
+            newImage->setCachedResourceLoader(document->cachedResourceLoader());
+            document->cachedResourceLoader()->m_documentResources.set(newImage->url(), newImage);
+            document->cachedResourceLoader()->setAutoLoadImages(autoLoadOtherImages);
         } else
-            newImage = document->docLoader()->requestImage(sourceURI(attr));
+            newImage = document->cachedResourceLoader()->requestImage(sourceURI(attr));
 
         // If we do not have an image here, it means that a cross-site
         // violation occurred.
diff --git a/WebCore/loader/Request.cpp b/WebCore/loader/Request.cpp
index 630a4bb..6ad6f9c 100644
--- a/WebCore/loader/Request.cpp
+++ b/WebCore/loader/Request.cpp
@@ -28,9 +28,9 @@
 
 namespace WebCore {
 
-Request::Request(DocLoader* docLoader, CachedResource* object, bool incremental, SecurityCheckPolicy shouldDoSecurityCheck, bool sendResourceLoadCallbacks)
+Request::Request(CachedResourceLoader* cachedResourceLoader, CachedResource* object, bool incremental, SecurityCheckPolicy shouldDoSecurityCheck, bool sendResourceLoadCallbacks)
     : m_object(object)
-    , m_docLoader(docLoader)
+    , m_cachedResourceLoader(cachedResourceLoader)
     , m_incremental(incremental)
     , m_multipart(false)
     , m_shouldDoSecurityCheck(shouldDoSecurityCheck)
diff --git a/WebCore/loader/Request.h b/WebCore/loader/Request.h
index 468f8ff..b6a9e90 100644
--- a/WebCore/loader/Request.h
+++ b/WebCore/loader/Request.h
@@ -29,16 +29,16 @@
 namespace WebCore {
 
     class CachedResource;
-    class DocLoader;
+    class CachedResourceLoader;
 
     class Request : public Noncopyable {
     public:
-        Request(DocLoader*, CachedResource*, bool incremental, SecurityCheckPolicy, bool sendResourceLoadCallbacks);
+        Request(CachedResourceLoader*, CachedResource*, bool incremental, SecurityCheckPolicy, bool sendResourceLoadCallbacks);
         ~Request();
         
         Vector<char>& buffer() { return m_buffer; }
         CachedResource* cachedResource() { return m_object; }
-        DocLoader* docLoader() { return m_docLoader; }
+        CachedResourceLoader* cachedResourceLoader() { return m_cachedResourceLoader; }
 
         bool isIncremental() { return m_incremental; }
         void setIsIncremental(bool b = true) { m_incremental = b; }
@@ -52,7 +52,7 @@ namespace WebCore {
     private:
         Vector<char> m_buffer;
         CachedResource* m_object;
-        DocLoader* m_docLoader;
+        CachedResourceLoader* m_cachedResourceLoader;
         bool m_incremental;
         bool m_multipart;
         SecurityCheckPolicy m_shouldDoSecurityCheck;
diff --git a/WebCore/loader/loader.cpp b/WebCore/loader/loader.cpp
index 345d881..3f6fad2 100644
--- a/WebCore/loader/loader.cpp
+++ b/WebCore/loader/loader.cpp
@@ -27,7 +27,7 @@
 #include "Cache.h"
 #include "CachedImage.h"
 #include "CachedResource.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "InspectorTimelineAgent.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -121,10 +121,10 @@ Loader::Priority Loader::determinePriority(const CachedResource* resource) const
 #endif
 }
 
-void Loader::load(DocLoader* docLoader, CachedResource* resource, bool incremental, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks)
+void Loader::load(CachedResourceLoader* cachedResourceLoader, CachedResource* resource, bool incremental, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks)
 {
-    ASSERT(docLoader);
-    Request* request = new Request(docLoader, resource, incremental, securityCheck, sendResourceLoadCallbacks);
+    ASSERT(cachedResourceLoader);
+    Request* request = new Request(cachedResourceLoader, resource, incremental, securityCheck, sendResourceLoadCallbacks);
 
     RefPtr<Host> host;
     KURL url(ParsedURLString, resource->url());
@@ -142,7 +142,7 @@ void Loader::load(DocLoader* docLoader, CachedResource* resource, bool increment
     bool hadRequests = host->hasRequests();
     Priority priority = determinePriority(resource);
     host->addRequest(request, priority);
-    docLoader->incrementRequestCount(request->cachedResource());
+    cachedResourceLoader->incrementRequestCount(request->cachedResource());
 
     if (priority > Low || !url.protocolInHTTPFamily() || (priority == Low && !hadRequests)) {
         // Try to request important resources immediately
@@ -151,7 +151,7 @@ void Loader::load(DocLoader* docLoader, CachedResource* resource, bool increment
         // Handle asynchronously so early low priority requests don't get scheduled before later high priority ones
 #if ENABLE(INSPECTOR)
         if (InspectorTimelineAgent::instanceCount()) {
-            InspectorTimelineAgent* agent = docLoader->doc()->inspectorTimelineAgent();
+            InspectorTimelineAgent* agent = cachedResourceLoader->doc()->inspectorTimelineAgent();
             if (agent)
                 agent->didScheduleResourceRequest(resource->url());
         }
@@ -243,12 +243,12 @@ void Loader::nonCacheRequestComplete(const KURL& url)
     host->nonCacheRequestComplete();
 }
 
-void Loader::cancelRequests(DocLoader* docLoader)
+void Loader::cancelRequests(CachedResourceLoader* cachedResourceLoader)
 {
-    docLoader->clearPendingPreloads();
+    cachedResourceLoader->clearPendingPreloads();
 
     if (m_nonHTTPProtocolHost->hasRequests())
-        m_nonHTTPProtocolHost->cancelRequests(docLoader);
+        m_nonHTTPProtocolHost->cancelRequests(cachedResourceLoader);
     
     Vector<Host*> hostsToCancel;
     m_hosts.checkConsistency();
@@ -260,12 +260,12 @@ void Loader::cancelRequests(DocLoader* docLoader)
     for (unsigned n = 0; n < hostsToCancel.size(); ++n) {
         Host* host = hostsToCancel[n];
         if (host->hasRequests())
-            host->cancelRequests(docLoader);
+            host->cancelRequests(cachedResourceLoader);
     }
 
     scheduleServePendingRequests();
     
-    ASSERT(docLoader->requestCount() == (docLoader->loadInProgress() ? 1 : 0));
+    ASSERT(cachedResourceLoader->requestCount() == (cachedResourceLoader->loadInProgress() ? 1 : 0));
 }
 
 Loader::Host::Host(const AtomicString& name, unsigned maxRequestsInFlight)
@@ -326,13 +326,13 @@ void Loader::Host::servePendingRequests(RequestQueue& requestsPending, bool& ser
 {
     while (!requestsPending.isEmpty()) {        
         Request* request = requestsPending.first();
-        DocLoader* docLoader = request->docLoader();
+        CachedResourceLoader* cachedResourceLoader = request->cachedResourceLoader();
         bool resourceIsCacheValidator = request->cachedResource()->isCacheValidator();
 
         // For named hosts - which are only http(s) hosts - we should always enforce the connection limit.
         // For non-named hosts - everything but http(s) - we should only enforce the limit if the document isn't done parsing 
         // and we don't know all stylesheets yet.
-        bool shouldLimitRequests = !m_name.isNull() || docLoader->doc()->parsing() || !docLoader->doc()->haveStylesheetsLoaded();
+        bool shouldLimitRequests = !m_name.isNull() || cachedResourceLoader->doc()->parsing() || !cachedResourceLoader->doc()->haveStylesheetsLoaded();
         if (shouldLimitRequests && m_requestsLoading.size() + m_nonCachedRequestsInFlight >= m_maxRequestsInFlight) {
             serveLowerPriority = false;
             return;
@@ -354,8 +354,8 @@ void Loader::Host::servePendingRequests(RequestQueue& requestsPending, bool& ser
             const String& lastModified = resourceToRevalidate->response().httpHeaderField("Last-Modified");
             const String& eTag = resourceToRevalidate->response().httpHeaderField("ETag");
             if (!lastModified.isEmpty() || !eTag.isEmpty()) {
-                ASSERT(docLoader->cachePolicy() != CachePolicyReload);
-                if (docLoader->cachePolicy() == CachePolicyRevalidate)
+                ASSERT(cachedResourceLoader->cachePolicy() != CachePolicyReload);
+                if (cachedResourceLoader->cachePolicy() == CachePolicyRevalidate)
                     resourceRequest.setHTTPHeaderField("Cache-Control", "max-age=0");
                 if (!lastModified.isEmpty())
                     resourceRequest.setHTTPHeaderField("If-Modified-Since", lastModified);
@@ -364,7 +364,7 @@ void Loader::Host::servePendingRequests(RequestQueue& requestsPending, bool& ser
             }
         }
 
-        RefPtr<SubresourceLoader> loader = SubresourceLoader::create(docLoader->doc()->frame(),
+        RefPtr<SubresourceLoader> loader = SubresourceLoader::create(cachedResourceLoader->doc()->frame(),
             this, resourceRequest, request->shouldDoSecurityCheck(), request->sendResourceLoadCallbacks());
         if (loader) {
             m_requestsLoading.add(loader.release(), request);
@@ -373,10 +373,10 @@ void Loader::Host::servePendingRequests(RequestQueue& requestsPending, bool& ser
             printf("HOST %s COUNT %d LOADING %s\n", resourceRequest.url().host().latin1().data(), m_requestsLoading.size(), request->cachedResource()->url().latin1().data());
 #endif
         } else {            
-            docLoader->decrementRequestCount(request->cachedResource());
-            docLoader->setLoadInProgress(true);
+            cachedResourceLoader->decrementRequestCount(request->cachedResource());
+            cachedResourceLoader->setLoadInProgress(true);
             request->cachedResource()->error();
-            docLoader->setLoadInProgress(false);
+            cachedResourceLoader->setLoadInProgress(false);
             delete request;
         }
     }
@@ -392,12 +392,12 @@ void Loader::Host::didFinishLoading(SubresourceLoader* loader)
     
     Request* request = i->second;
     m_requestsLoading.remove(i);
-    DocLoader* docLoader = request->docLoader();
+    CachedResourceLoader* cachedResourceLoader = request->cachedResourceLoader();
     // Prevent the document from being destroyed before we are done with
-    // the docLoader that it will delete when the document gets deleted.
-    RefPtr<Document> protector(docLoader->doc());
+    // the cachedResourceLoader that it will delete when the document gets deleted.
+    RefPtr<Document> protector(cachedResourceLoader->doc());
     if (!request->isMultipart())
-        docLoader->decrementRequestCount(request->cachedResource());
+        cachedResourceLoader->decrementRequestCount(request->cachedResource());
 
     CachedResource* resource = request->cachedResource();
     ASSERT(!resource->resourceToRevalidate());
@@ -405,16 +405,16 @@ void Loader::Host::didFinishLoading(SubresourceLoader* loader)
     // If we got a 4xx response, we're pretending to have received a network
     // error, so we can't send the successful data() and finish() callbacks.
     if (!resource->errorOccurred()) {
-        docLoader->setLoadInProgress(true);
+        cachedResourceLoader->setLoadInProgress(true);
         resource->data(loader->resourceData(), true);
         resource->finish();
     }
 
     delete request;
 
-    docLoader->setLoadInProgress(false);
+    cachedResourceLoader->setLoadInProgress(false);
     
-    docLoader->checkForPendingPreloads();
+    cachedResourceLoader->checkForPendingPreloads();
 
 #if REQUEST_DEBUG
     KURL u(ParsedURLString, resource->url());
@@ -440,12 +440,12 @@ void Loader::Host::didFail(SubresourceLoader* loader, bool cancelled)
     
     Request* request = i->second;
     m_requestsLoading.remove(i);
-    DocLoader* docLoader = request->docLoader();
+    CachedResourceLoader* cachedResourceLoader = request->cachedResourceLoader();
     // Prevent the document from being destroyed before we are done with
-    // the docLoader that it will delete when the document gets deleted.
-    RefPtr<Document> protector(docLoader->doc());
+    // the cachedResourceLoader that it will delete when the document gets deleted.
+    RefPtr<Document> protector(cachedResourceLoader->doc());
     if (!request->isMultipart())
-        docLoader->decrementRequestCount(request->cachedResource());
+        cachedResourceLoader->decrementRequestCount(request->cachedResource());
 
     CachedResource* resource = request->cachedResource();
     
@@ -453,17 +453,17 @@ void Loader::Host::didFail(SubresourceLoader* loader, bool cancelled)
         cache()->revalidationFailed(resource);
 
     if (!cancelled) {
-        docLoader->setLoadInProgress(true);
+        cachedResourceLoader->setLoadInProgress(true);
         resource->error();
     }
     
-    docLoader->setLoadInProgress(false);
+    cachedResourceLoader->setLoadInProgress(false);
     if (cancelled || !resource->isPreloaded())
         cache()->remove(resource);
     
     delete request;
     
-    docLoader->checkForPendingPreloads();
+    cachedResourceLoader->checkForPendingPreloads();
 
     servePendingRequests();
 }
@@ -490,13 +490,13 @@ void Loader::Host::didReceiveResponse(SubresourceLoader* loader, const ResourceR
             // 304 Not modified / Use local copy
             m_requestsLoading.remove(loader);
             loader->clearClient();
-            request->docLoader()->decrementRequestCount(request->cachedResource());
+            request->cachedResourceLoader()->decrementRequestCount(request->cachedResource());
 
             // Existing resource is ok, just use it updating the expiration time.
             cache()->revalidationSucceeded(resource, response);
             
-            if (request->docLoader()->frame())
-                request->docLoader()->frame()->loader()->checkCompleted();
+            if (request->cachedResourceLoader()->frame())
+                request->cachedResourceLoader()->frame()->loader()->checkCompleted();
 
             delete request;
 
@@ -516,13 +516,13 @@ void Loader::Host::didReceiveResponse(SubresourceLoader* loader, const ResourceR
     if (request->isMultipart()) {
         ASSERT(resource->isImage());
         static_cast<CachedImage*>(resource)->clear();
-        if (request->docLoader()->frame())
-            request->docLoader()->frame()->loader()->checkCompleted();
+        if (request->cachedResourceLoader()->frame())
+            request->cachedResourceLoader()->frame()->loader()->checkCompleted();
     } else if (response.isMultipart()) {
         request->setIsMultipart(true);
         
-        // We don't count multiParts in a DocLoader's request count
-        request->docLoader()->decrementRequestCount(request->cachedResource());
+        // We don't count multiParts in a CachedResourceLoader's request count
+        request->cachedResourceLoader()->decrementRequestCount(request->cachedResource());
 
         // If we get a multipart response, we must have a handle
         ASSERT(loader->handle());
@@ -574,15 +574,15 @@ void Loader::Host::didReceiveCachedMetadata(SubresourceLoader* loader, const cha
     resource->setSerializedCachedMetadata(data, size);
 }
     
-void Loader::Host::cancelPendingRequests(RequestQueue& requestsPending, DocLoader* docLoader)
+void Loader::Host::cancelPendingRequests(RequestQueue& requestsPending, CachedResourceLoader* cachedResourceLoader)
 {
     RequestQueue remaining;
     RequestQueue::iterator end = requestsPending.end();
     for (RequestQueue::iterator it = requestsPending.begin(); it != end; ++it) {
         Request* request = *it;
-        if (request->docLoader() == docLoader) {
+        if (request->cachedResourceLoader() == cachedResourceLoader) {
             cache()->remove(request->cachedResource());
-            docLoader->decrementRequestCount(request->cachedResource());
+            cachedResourceLoader->decrementRequestCount(request->cachedResource());
             delete request;
         } else
             remaining.append(request);
@@ -590,17 +590,17 @@ void Loader::Host::cancelPendingRequests(RequestQueue& requestsPending, DocLoade
     requestsPending.swap(remaining);
 }
 
-void Loader::Host::cancelRequests(DocLoader* docLoader)
+void Loader::Host::cancelRequests(CachedResourceLoader* cachedResourceLoader)
 {
     for (unsigned p = 0; p <= High; p++)
-        cancelPendingRequests(m_requestsPending[p], docLoader);
+        cancelPendingRequests(m_requestsPending[p], cachedResourceLoader);
 
     Vector<SubresourceLoader*, 256> loadersToCancel;
 
     RequestMap::iterator end = m_requestsLoading.end();
     for (RequestMap::iterator i = m_requestsLoading.begin(); i != end; ++i) {
         Request* r = i->second;
-        if (r->docLoader() == docLoader)
+        if (r->cachedResourceLoader() == cachedResourceLoader)
             loadersToCancel.append(i->first.get());
     }
 
diff --git a/WebCore/loader/loader.h b/WebCore/loader/loader.h
index 52c61aa..4d353e0 100644
--- a/WebCore/loader/loader.h
+++ b/WebCore/loader/loader.h
@@ -35,7 +35,7 @@
 namespace WebCore {
 
     class CachedResource;
-    class DocLoader;
+    class CachedResourceLoader;
     class KURL;
     class Request;
 
@@ -44,9 +44,9 @@ namespace WebCore {
         Loader();
         ~Loader();
 
-        void load(DocLoader*, CachedResource*, bool incremental = true, SecurityCheckPolicy = DoSecurityCheck, bool sendResourceLoadCallbacks = true);
+        void load(CachedResourceLoader*, CachedResource*, bool incremental = true, SecurityCheckPolicy = DoSecurityCheck, bool sendResourceLoadCallbacks = true);
 
-        void cancelRequests(DocLoader*);
+        void cancelRequests(CachedResourceLoader*);
         
         enum Priority { VeryLow, Low, Medium, High };
         void servePendingRequests(Priority minimumPriority = VeryLow);
@@ -77,7 +77,7 @@ namespace WebCore {
             void nonCacheRequestInFlight();
             void nonCacheRequestComplete();
             void servePendingRequests(Priority minimumPriority = VeryLow);
-            void cancelRequests(DocLoader*);
+            void cancelRequests(CachedResourceLoader*);
             bool hasRequests() const;
 
             bool processingResource() const { return m_numResourcesProcessing != 0 || m_nonCachedRequestsInFlight !=0; }
@@ -94,7 +94,7 @@ namespace WebCore {
             typedef Deque<Request*> RequestQueue;
             void servePendingRequests(RequestQueue& requestsPending, bool& serveLowerPriority);
             void didFail(SubresourceLoader*, bool cancelled = false);
-            void cancelPendingRequests(RequestQueue& requestsPending, DocLoader*);
+            void cancelPendingRequests(RequestQueue& requestsPending, CachedResourceLoader*);
             
             RequestQueue m_requestsPending[High + 1];
             typedef HashMap<RefPtr<SubresourceLoader>, Request*> RequestMap;
diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp
index bbf4fed..2b41142 100644
--- a/WebCore/page/DragController.cpp
+++ b/WebCore/page/DragController.cpp
@@ -30,7 +30,7 @@
 #include "CSSStyleDeclaration.h"
 #include "Clipboard.h"
 #include "ClipboardAccessPolicy.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "DocumentFragment.h"
 #include "DragActions.h"
@@ -440,13 +440,13 @@ bool DragController::concludeEditDrag(DragData* dragData)
     // manually controlling drag behaviour
     if (!range)
         return false;
-    DocLoader* loader = range->ownerDocument()->docLoader();
-    loader->setAllowStaleResources(true);
+    CachedResourceLoader* cachedResourceLoader = range->ownerDocument()->cachedResourceLoader();
+    cachedResourceLoader->setAllowStaleResources(true);
     if (dragIsMove(innerFrame->selection()) || dragCaret.isContentRichlyEditable()) {
         bool chosePlainText = false;
         RefPtr<DocumentFragment> fragment = documentFragmentFromDragData(dragData, range, true, chosePlainText);
         if (!fragment || !innerFrame->editor()->shouldInsertFragment(fragment, range, EditorInsertActionDropped)) {
-            loader->setAllowStaleResources(false);
+            cachedResourceLoader->setAllowStaleResources(false);
             return false;
         }
 
@@ -464,7 +464,7 @@ bool DragController::concludeEditDrag(DragData* dragData)
     } else {
         String text = dragData->asPlainText();
         if (text.isEmpty() || !innerFrame->editor()->shouldInsertText(text, range.get(), EditorInsertActionDropped)) {
-            loader->setAllowStaleResources(false);
+            cachedResourceLoader->setAllowStaleResources(false);
             return false;
         }
 
@@ -472,7 +472,7 @@ bool DragController::concludeEditDrag(DragData* dragData)
         if (setSelectionToDragCaret(innerFrame, dragCaret, range, point))
             applyCommand(ReplaceSelectionCommand::create(m_documentUnderMouse.get(), createFragmentFromText(range.get(), text), true, false, true));
     }
-    loader->setAllowStaleResources(false);
+    cachedResourceLoader->setAllowStaleResources(false);
 
     return true;
 }
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index e5d5bdb..a2784d1 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -38,7 +38,7 @@
 #include "Chrome.h"
 #include "ChromeClient.h"
 #include "DOMWindow.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "DocumentType.h"
 #include "EditingText.h"
 #include "EditorClient.h"
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 65fa49f..c1e39ca 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -31,7 +31,7 @@
 #include "CSSStyleSelector.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "EventHandler.h"
 #include "FloatRect.h"
 #include "FocusController.h"
@@ -1270,7 +1270,7 @@ void FrameView::checkStopDelayingDeferredRepaints()
         return;
 
     Document* document = m_frame->document();
-    if (document && (document->parsing() || document->docLoader()->requestCount()))
+    if (document && (document->parsing() || document->cachedResourceLoader()->requestCount()))
         return;
     
     m_deferredRepaintTimer.stop();
@@ -1305,7 +1305,7 @@ void FrameView::doDeferredRepaints()
 void FrameView::updateDeferredRepaintDelay()
 {
     Document* document = m_frame->document();
-    if (!document || (!document->parsing() && !document->docLoader()->requestCount())) {
+    if (!document || (!document->parsing() && !document->cachedResourceLoader()->requestCount())) {
         m_deferredRepaintDelay = s_deferredRepaintDelay;
         return;
     }
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index 6c70fae..8acfc69 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -28,7 +28,7 @@
 
 #include "BackForwardList.h"
 #include "Database.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Frame.h"
 #include "FrameTree.h"
 #include "FrameView.h"
@@ -51,7 +51,7 @@ static void setNeedsRecalcStyleInAllFrames(Page* page)
 static void setLoadsImagesAutomaticallyInAllFrames(Page* page)
 {
     for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
-        frame->document()->docLoader()->setAutoLoadImages(page->settings()->loadsImagesAutomatically());
+        frame->document()->cachedResourceLoader()->setAutoLoadImages(page->settings()->loadsImagesAutomatically());
 }
 
 #if USE(SAFARI_THEME)
diff --git a/WebCore/platform/android/TemporaryLinkStubs.cpp b/WebCore/platform/android/TemporaryLinkStubs.cpp
index 29bcc95..fe4514b 100644
--- a/WebCore/platform/android/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/android/TemporaryLinkStubs.cpp
@@ -105,7 +105,7 @@ namespace WebCore {
 
 // This function tells the bridge that a resource was loaded from the cache and thus
 // the app may update progress with the amount of data loaded.
-void CheckCacheObjectStatus(DocLoader*, CachedResource*)
+void CheckCacheObjectStatus(CachedResourceLoader*, CachedResource*)
 {
     ASSERT_NOT_REACHED();
     notImplemented();
diff --git a/WebCore/platform/network/android/ResourceHandleAndroid.cpp b/WebCore/platform/network/android/ResourceHandleAndroid.cpp
index 584ec52..39331a3 100644
--- a/WebCore/platform/network/android/ResourceHandleAndroid.cpp
+++ b/WebCore/platform/network/android/ResourceHandleAndroid.cpp
@@ -27,7 +27,7 @@
 
 #include "ResourceHandle.h"
 
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "DocumentLoader.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -50,8 +50,8 @@ ResourceHandle::~ResourceHandle()
 
 bool ResourceHandle::start(Frame* frame)
 {
-    DocumentLoader* docLoader = frame->loader()->activeDocumentLoader();
-    MainResourceLoader* mainLoader = docLoader->mainResourceLoader();
+    DocumentLoader* documentLoader = frame->loader()->activeDocumentLoader();
+    MainResourceLoader* mainLoader = documentLoader->mainResourceLoader();
     bool isMainResource = mainLoader && (mainLoader->handle() == this);
 
     PassRefPtr<ResourceLoaderAndroid> loader = ResourceLoaderAndroid::start(this, d->m_request, frame->loader()->client(), isMainResource, false);
diff --git a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
index 419e397..209906e 100644
--- a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
+++ b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
@@ -34,7 +34,7 @@
 #include "Base64.h"
 #include "CookieStorageWin.h"
 #include "CredentialStorage.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "FormDataStreamCFNet.h"
 #include "Frame.h"
 #include "FrameLoader.h"
diff --git a/WebCore/platform/network/curl/ResourceHandleCurl.cpp b/WebCore/platform/network/curl/ResourceHandleCurl.cpp
index a4c1f8e..096905d 100644
--- a/WebCore/platform/network/curl/ResourceHandleCurl.cpp
+++ b/WebCore/platform/network/curl/ResourceHandleCurl.cpp
@@ -28,7 +28,7 @@
 #include "config.h"
 #include "ResourceHandle.h"
 
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "NotImplemented.h"
 #include "ResourceHandleInternal.h"
 #include "ResourceHandleManager.h"
diff --git a/WebCore/platform/network/mac/ResourceHandleMac.mm b/WebCore/platform/network/mac/ResourceHandleMac.mm
index d014bb3..0af86d0 100644
--- a/WebCore/platform/network/mac/ResourceHandleMac.mm
+++ b/WebCore/platform/network/mac/ResourceHandleMac.mm
@@ -32,7 +32,7 @@
 #import "BlobRegistry.h"
 #import "BlockExceptions.h"
 #import "CredentialStorage.h"
-#import "DocLoader.h"
+#import "CachedResourceLoader.h"
 #import "EmptyProtocolDefinitions.h"
 #import "FormDataStreamMac.h"
 #import "Frame.h"
diff --git a/WebCore/platform/network/qt/ResourceHandleQt.cpp b/WebCore/platform/network/qt/ResourceHandleQt.cpp
index f91eecb..3548467 100644
--- a/WebCore/platform/network/qt/ResourceHandleQt.cpp
+++ b/WebCore/platform/network/qt/ResourceHandleQt.cpp
@@ -31,7 +31,7 @@
 #include "ResourceHandle.h"
 
 #include "ChromeClientQt.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Frame.h"
 #include "FrameLoaderClientQt.h"
 #include "NotImplemented.h"
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index 96a2f25..dadbd22 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -31,7 +31,7 @@
 #include "CString.h"
 #include "ChromeClient.h"
 #include "CookieJarSoup.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "FileSystem.h"
 #include "Frame.h"
 #include "GOwnPtrSoup.h"
diff --git a/WebCore/platform/network/win/ResourceHandleWin.cpp b/WebCore/platform/network/win/ResourceHandleWin.cpp
index 3dabd91..2af03c0 100644
--- a/WebCore/platform/network/win/ResourceHandleWin.cpp
+++ b/WebCore/platform/network/win/ResourceHandleWin.cpp
@@ -27,7 +27,7 @@
 #include "config.h"
 #include "ResourceHandle.h"
 
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "Frame.h"
 #include "FrameLoader.h"
diff --git a/WebCore/svg/SVGFEImageElement.cpp b/WebCore/svg/SVGFEImageElement.cpp
index 0808ad7..b9d1a3d 100644
--- a/WebCore/svg/SVGFEImageElement.cpp
+++ b/WebCore/svg/SVGFEImageElement.cpp
@@ -26,7 +26,7 @@
 
 #include "Attr.h"
 #include "CachedImage.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "RenderObject.h"
 #include "RenderSVGResource.h"
@@ -64,7 +64,7 @@ void SVGFEImageElement::requestImageResource()
     if (hrefElement && hrefElement->isSVGElement() && hrefElement->renderer())
         return;
 
-    m_cachedImage = ownerDocument()->docLoader()->requestImage(href());
+    m_cachedImage = ownerDocument()->cachedResourceLoader()->requestImage(href());
 
     if (m_cachedImage)
         m_cachedImage->addClient(this);
diff --git a/WebCore/svg/SVGFontFaceUriElement.cpp b/WebCore/svg/SVGFontFaceUriElement.cpp
index 4d03b2b..3ecba16 100644
--- a/WebCore/svg/SVGFontFaceUriElement.cpp
+++ b/WebCore/svg/SVGFontFaceUriElement.cpp
@@ -26,7 +26,7 @@
 #include "Attribute.h"
 #include "CSSFontFaceSrcValue.h"
 #include "CachedFont.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "SVGFontFaceElement.h"
 #include "SVGNames.h"
@@ -94,12 +94,12 @@ void SVGFontFaceUriElement::loadFont()
 
     String href = getAttribute(XLinkNames::hrefAttr);
     if (!href.isNull()) {        
-        DocLoader* docLoader = document()->docLoader();
-        m_cachedFont = docLoader->requestFont(href);
+        CachedResourceLoader* cachedResourceLoader = document()->cachedResourceLoader();
+        m_cachedFont = cachedResourceLoader->requestFont(href);
         if (m_cachedFont) {
             m_cachedFont->setSVGFont(true);
             m_cachedFont->addClient(this);
-            m_cachedFont->beginLoadIfNeeded(docLoader);
+            m_cachedFont->beginLoadIfNeeded(cachedResourceLoader);
         }
     } else
         m_cachedFont = 0;
diff --git a/WebCore/workers/Worker.cpp b/WebCore/workers/Worker.cpp
index fda7c72..32ec997 100644
--- a/WebCore/workers/Worker.cpp
+++ b/WebCore/workers/Worker.cpp
@@ -32,7 +32,7 @@
 #include "Worker.h"
 
 #include "DOMWindow.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "EventException.h"
 #include "EventListener.h"
diff --git a/WebCore/xml/XSLImportRule.cpp b/WebCore/xml/XSLImportRule.cpp
index 0908d75..c32da4e 100644
--- a/WebCore/xml/XSLImportRule.cpp
+++ b/WebCore/xml/XSLImportRule.cpp
@@ -25,7 +25,7 @@
 #if ENABLE(XSLT)
 
 #include "CachedXSLStyleSheet.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "XSLStyleSheet.h"
 
 namespace WebCore {
@@ -77,13 +77,13 @@ bool XSLImportRule::isLoading()
 
 void XSLImportRule::loadSheet()
 {
-    DocLoader* docLoader = 0;
+    CachedResourceLoader* cachedResourceLoader = 0;
     StyleBase* root = this;
     StyleBase* parent;
     while ((parent = root->parent()))
         root = parent;
     if (root->isXSLStyleSheet())
-        docLoader = static_cast<XSLStyleSheet*>(root)->docLoader();
+        cachedResourceLoader = static_cast<XSLStyleSheet*>(root)->cachedResourceLoader();
     
     String absHref = m_strHref;
     XSLStyleSheet* parentSheet = parentStyleSheet();
@@ -98,7 +98,7 @@ void XSLImportRule::loadSheet()
             return;
     }
     
-    m_cachedSheet = docLoader->requestXSLStyleSheet(absHref);
+    m_cachedSheet = cachedResourceLoader->requestXSLStyleSheet(absHref);
     
     if (m_cachedSheet) {
         m_cachedSheet->addClient(this);
diff --git a/WebCore/xml/XSLStyleSheet.h b/WebCore/xml/XSLStyleSheet.h
index e6e4063..acf5ea3 100644
--- a/WebCore/xml/XSLStyleSheet.h
+++ b/WebCore/xml/XSLStyleSheet.h
@@ -36,7 +36,7 @@
 
 namespace WebCore {
 
-class DocLoader;
+class CachedResourceLoader;
 class Document;
 class XSLImportRule;
     
@@ -71,7 +71,7 @@ public:
     void loadChildSheets();
     void loadChildSheet(const String& href);
 
-    DocLoader* docLoader();
+    CachedResourceLoader* cachedResourceLoader();
 
     Document* ownerDocument() { return m_ownerDocument; }
     void setParentStyleSheet(XSLStyleSheet* parent);
diff --git a/WebCore/xml/XSLStyleSheetLibxslt.cpp b/WebCore/xml/XSLStyleSheetLibxslt.cpp
index 10919ef..3fb9eb5 100644
--- a/WebCore/xml/XSLStyleSheetLibxslt.cpp
+++ b/WebCore/xml/XSLStyleSheetLibxslt.cpp
@@ -26,7 +26,7 @@
 
 #include "Console.h"
 #include "DOMWindow.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Document.h"
 #include "Frame.h"
 #include "Node.h"
@@ -128,11 +128,11 @@ void XSLStyleSheet::clearDocuments()
     }
 }
 
-DocLoader* XSLStyleSheet::docLoader()
+CachedResourceLoader* XSLStyleSheet::cachedResourceLoader()
 {
     if (!m_ownerDocument)
         return 0;
-    return m_ownerDocument->docLoader();
+    return m_ownerDocument->cachedResourceLoader();
 }
 
 bool XSLStyleSheet::parseString(const String& string, bool)
@@ -148,7 +148,7 @@ bool XSLStyleSheet::parseString(const String& string, bool)
     if (Frame* frame = ownerDocument()->frame())
         console = frame->domWindow()->console();
 
-    XMLDocumentParserScope scope(docLoader(), XSLTProcessor::genericErrorFunc, XSLTProcessor::parseErrorFunc, console);
+    XMLDocumentParserScope scope(cachedResourceLoader(), XSLTProcessor::genericErrorFunc, XSLTProcessor::parseErrorFunc, console);
 
     const char* buffer = reinterpret_cast<const char*>(string.characters());
     int size = string.length() * sizeof(UChar);
diff --git a/WebCore/xml/XSLStyleSheetQt.cpp b/WebCore/xml/XSLStyleSheetQt.cpp
index cb55993..0523560 100644
--- a/WebCore/xml/XSLStyleSheetQt.cpp
+++ b/WebCore/xml/XSLStyleSheetQt.cpp
@@ -61,11 +61,11 @@ void XSLStyleSheet::clearDocuments()
     notImplemented();
 }
 
-DocLoader* XSLStyleSheet::docLoader()
+CachedResourceLoader* XSLStyleSheet::cachedResourceLoader()
 {
     if (!m_ownerDocument)
         return 0;
-    return m_ownerDocument->docLoader();
+    return m_ownerDocument->cachedResourceLoader();
 }
 
 bool XSLStyleSheet::parseString(const String& string, bool)
diff --git a/WebCore/xml/XSLTProcessor.cpp b/WebCore/xml/XSLTProcessor.cpp
index 41569d7..bdae0cd 100644
--- a/WebCore/xml/XSLTProcessor.cpp
+++ b/WebCore/xml/XSLTProcessor.cpp
@@ -27,7 +27,7 @@
 #include "XSLTProcessor.h"
 
 #include "DOMImplementation.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "DocumentFragment.h"
 #include "Frame.h"
 #include "FrameLoader.h"
diff --git a/WebCore/xml/XSLTProcessorLibxslt.cpp b/WebCore/xml/XSLTProcessorLibxslt.cpp
index ed4303d..c2869c7 100644
--- a/WebCore/xml/XSLTProcessorLibxslt.cpp
+++ b/WebCore/xml/XSLTProcessorLibxslt.cpp
@@ -28,7 +28,7 @@
 
 #include "Console.h"
 #include "DOMWindow.h"
-#include "DocLoader.h"
+#include "CachedResourceLoader.h"
 #include "Frame.h"
 #include "ResourceError.h"
 #include "ResourceHandle.h"
@@ -96,12 +96,12 @@ void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error)
 
 // FIXME: There seems to be no way to control the ctxt pointer for loading here, thus we have globals.
 static XSLTProcessor* globalProcessor = 0;
-static DocLoader* globalDocLoader = 0;
+static CachedResourceLoader* globalCachedResourceLoader = 0;
 static xmlDocPtr docLoaderFunc(const xmlChar* uri,
-                                    xmlDictPtr,
-                                    int options,
-                                    void* ctxt,
-                                    xsltLoadType type)
+                               xmlDictPtr,
+                               int options,
+                               void* ctxt,
+                               xsltLoadType type)
 {
     if (!globalProcessor)
         return 0;
@@ -117,14 +117,14 @@ static xmlDocPtr docLoaderFunc(const xmlChar* uri,
 
         Vector<char> data;
 
-        bool requestAllowed = globalDocLoader->frame() && globalDocLoader->doc()->securityOrigin()->canRequest(url);
+        bool requestAllowed = globalCachedResourceLoader->frame() && globalCachedResourceLoader->doc()->securityOrigin()->canRequest(url);
         if (requestAllowed) {
-            globalDocLoader->frame()->loader()->loadResourceSynchronously(url, AllowStoredCredentials, error, response, data);
-            requestAllowed = globalDocLoader->doc()->securityOrigin()->canRequest(response.url());
+            globalCachedResourceLoader->frame()->loader()->loadResourceSynchronously(url, AllowStoredCredentials, error, response, data);
+            requestAllowed = globalCachedResourceLoader->doc()->securityOrigin()->canRequest(response.url());
         }
         if (!requestAllowed) {
             data.clear();
-            globalDocLoader->printAccessDeniedMessage(url);
+            globalCachedResourceLoader->printAccessDeniedMessage(url);
         }
 
         Console* console = 0;
@@ -151,11 +151,11 @@ static xmlDocPtr docLoaderFunc(const xmlChar* uri,
     return 0;
 }
 
-static inline void setXSLTLoadCallBack(xsltDocLoaderFunc func, XSLTProcessor* processor, DocLoader* loader)
+static inline void setXSLTLoadCallBack(xsltDocLoaderFunc func, XSLTProcessor* processor, CachedResourceLoader* cachedResourceLoader)
 {
     xsltSetLoaderFunc(func);
     globalProcessor = processor;
-    globalDocLoader = loader;
+    globalCachedResourceLoader = cachedResourceLoader;
 }
 
 static int writeToVector(void* context, const char* buffer, int len)
@@ -245,7 +245,7 @@ static inline xmlDocPtr xmlDocPtrFromNode(Node* sourceNode, bool& shouldDelete)
     if (sourceIsDocument && ownerDocument->transformSource())
         sourceDoc = (xmlDocPtr)ownerDocument->transformSource()->platformSource();
     if (!sourceDoc) {
-        sourceDoc = (xmlDocPtr)xmlDocPtrForString(ownerDocument->docLoader(), createMarkup(sourceNode),
+        sourceDoc = (xmlDocPtr)xmlDocPtrForString(ownerDocument->cachedResourceLoader(), createMarkup(sourceNode),
             sourceIsDocument ? ownerDocument->url().string() : String());
         shouldDelete = sourceDoc;
     }
@@ -275,7 +275,7 @@ bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String
 {
     RefPtr<Document> ownerDocument = sourceNode->document();
 
-    setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->docLoader());
+    setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->cachedResourceLoader());
     xsltStylesheetPtr sheet = xsltStylesheetPointer(m_stylesheet, m_stylesheetRootNode.get());
     if (!sheet) {
         setXSLTLoadCallBack(0, 0, 0);
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 0ba7d60..09bfd69 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-08  Adam Barth  <abarth at webkit.org>
+
+        Rubber-stamped by Eric Seidel.
+
+        Rename DocLoader to CachedResourceLoader because that's what it does.
+
+        * WebView/WebFrame.mm:
+
 2010-09-07  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Oliver Hunt.
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 6315d43..a3b6f9e 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -60,7 +60,7 @@
 #import <WebCore/Chrome.h>
 #import <WebCore/ColorMac.h>
 #import <WebCore/DOMImplementation.h>
-#import <WebCore/DocLoader.h>
+#import <WebCore/CachedResourceLoader.h>
 #import <WebCore/DocumentFragment.h>
 #import <WebCore/EventHandler.h>
 #import <WebCore/EventNames.h>
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 44e2f78..0d06030 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-08  Adam Barth  <abarth at webkit.org>
+
+        Rubber-stamped by Eric Seidel.
+
+        Rename DocLoader to CachedResourceLoader because that's what it does.
+
+        * WebDataSource.cpp:
+
 2010-09-07  Brent Fulgham  <bfulgham at webkit.org>
 
         Reviewed by Adam Roben.
diff --git a/WebKit/win/WebDataSource.cpp b/WebKit/win/WebDataSource.cpp
index 566f174..3d260e0 100644
--- a/WebKit/win/WebDataSource.cpp
+++ b/WebKit/win/WebDataSource.cpp
@@ -39,7 +39,7 @@
 #include "WebResource.h"
 #include "WebURLResponse.h"
 #include <WebCore/BString.h>
-#include <WebCore/DocLoader.h>
+#include <WebCore/CachedResourceLoader.h>
 #include <WebCore/Document.h>
 #include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 28e4d7f..dbf7341 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-08  Adam Barth  <abarth at webkit.org>
+
+        Rubber-stamped by Eric Seidel.
+
+        Rename DocLoader to CachedResourceLoader because that's what it does.
+
+        * Scripts/do-webcore-rename:
+
 2010-09-07  Kinuko Yasuda  <kinuko at chromium.org>
 
         Reviewed by Ojan Vafai.
diff --git a/WebKitTools/Scripts/do-webcore-rename b/WebKitTools/Scripts/do-webcore-rename
index 54fb0af..a1674de 100755
--- a/WebKitTools/Scripts/do-webcore-rename
+++ b/WebKitTools/Scripts/do-webcore-rename
@@ -96,7 +96,7 @@ sub wanted
 my $isDOMTypeRename = 0;
 my %renames = (
     # Renames go here in the form of:
-    # "HTMLDocumentParser" => "LegacyHTMLDocumentParser",
+    "DocLoader" => "CachedResourceLoader",
 );
 
 my %renamesContemplatedForTheFuture = (

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list