<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[146449] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/146449">146449</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2013-03-21 02:05:45 -0700 (Thu, 21 Mar 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge MainResourceLoader into DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=104969

Patch by Nate Chapin &lt;japhet@chromium.org&gt; on 2013-03-21
Reviewed by Adam Barth.

No new tests, refactor only.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader):
(WebCore::DocumentLoader::mainResourceLoader):
(WebCore::DocumentLoader::~DocumentLoader): Move main resource clearing from
    ~MainResourceLoader.
(WebCore::DocumentLoader::mainResourceData):
(WebCore::DocumentLoader::stopLoading):
(WebCore::DocumentLoader::notifyFinished): Moved from MainResourceLoader::notifyFinished.
(WebCore):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::handleSubstituteDataLoadNow):
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::continueAfterNavigationPolicy):
(WebCore::DocumentLoader::responseReceived):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::DocumentLoader::reportMemoryUsage):
(WebCore::DocumentLoader::dataReceived):
(WebCore::DocumentLoader::clearMainResourceLoader):
(WebCore::DocumentLoader::setDefersLoading):
(WebCore::DocumentLoader::setMainResourceDataBufferingPolicy):
(WebCore::DocumentLoader::addSubresourceLoader):
(WebCore::DocumentLoader::maybeLoadEmpty):
(WebCore::DocumentLoader::startLoadingMainResource): Don't keep separate checks
     for normal and empty loads, just use a single boolean.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::isLoadingMainResource):
* loader/MainResourceLoader.cpp: Removed.
* loader/MainResourceLoader.h: Removed.
* loader/mac/DocumentLoaderMac.cpp:
(WebCore::DocumentLoader::schedule):
(WebCore::DocumentLoader::unschedule):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreTargetpri">trunk/Source/WebCore/Target.pri</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCoregypi">trunk/Source/WebCore/WebCore.gypi</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcprojWebCorevcproj">trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoaderh">trunk/Source/WebCore/loader/DocumentLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloadermacDocumentLoaderMaccpp">trunk/Source/WebCore/loader/mac/DocumentLoaderMac.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreloaderMainResourceLoadercpp">trunk/Source/WebCore/loader/MainResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderMainResourceLoaderh">trunk/Source/WebCore/loader/MainResourceLoader.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/CMakeLists.txt        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -1686,7 +1686,6 @@
</span><span class="cx">     loader/ImageLoader.cpp
</span><span class="cx">     loader/LinkLoader.cpp
</span><span class="cx">     loader/LoaderStrategy.cpp
</span><del>-    loader/MainResourceLoader.cpp
</del><span class="cx">     loader/MixedContentChecker.cpp
</span><span class="cx">     loader/NavigationAction.cpp
</span><span class="cx">     loader/NetscapePlugInStreamLoader.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/ChangeLog        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2013-03-21  Nate Chapin  &lt;japhet@chromium.org&gt;
+
+        Merge MainResourceLoader into DocumentLoader
+        https://bugs.webkit.org/show_bug.cgi?id=104969
+
+        Reviewed by Adam Barth.
+
+        No new tests, refactor only.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.exp.in:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::DocumentLoader):
+        (WebCore::DocumentLoader::mainResourceLoader):
+        (WebCore::DocumentLoader::~DocumentLoader): Move main resource clearing from
+            ~MainResourceLoader.
+        (WebCore::DocumentLoader::mainResourceData):
+        (WebCore::DocumentLoader::stopLoading):
+        (WebCore::DocumentLoader::notifyFinished): Moved from MainResourceLoader::notifyFinished.
+        (WebCore):
+        (WebCore::DocumentLoader::finishedLoading):
+        (WebCore::DocumentLoader::handleSubstituteDataLoadNow):
+        (WebCore::DocumentLoader::redirectReceived):
+        (WebCore::DocumentLoader::continueAfterNavigationPolicy):
+        (WebCore::DocumentLoader::responseReceived):
+        (WebCore::DocumentLoader::continueAfterContentPolicy):
+        (WebCore::DocumentLoader::reportMemoryUsage):
+        (WebCore::DocumentLoader::dataReceived):
+        (WebCore::DocumentLoader::clearMainResourceLoader):
+        (WebCore::DocumentLoader::setDefersLoading):
+        (WebCore::DocumentLoader::setMainResourceDataBufferingPolicy):
+        (WebCore::DocumentLoader::addSubresourceLoader):
+        (WebCore::DocumentLoader::maybeLoadEmpty):
+        (WebCore::DocumentLoader::startLoadingMainResource): Don't keep separate checks
+             for normal and empty loads, just use a single boolean.
+        * loader/DocumentLoader.h:
+        (WebCore::DocumentLoader::isLoadingMainResource):
+        * loader/MainResourceLoader.cpp: Removed.
+        * loader/MainResourceLoader.h: Removed.
+        * loader/mac/DocumentLoaderMac.cpp:
+        (WebCore::DocumentLoader::schedule):
+        (WebCore::DocumentLoader::unschedule):
+
</ins><span class="cx"> 2013-03-20  Ilya Tikhonovsky  &lt;loislo@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Flame Chart. draw background for the FlameChart overview pane with the CPU aggregated data.
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -4078,8 +4078,6 @@
</span><span class="cx">         Source/WebCore/loader/LinkLoaderClient.h \
</span><span class="cx">         Source/WebCore/loader/LoaderStrategy.cpp \
</span><span class="cx">         Source/WebCore/loader/LoaderStrategy.h \
</span><del>-        Source/WebCore/loader/MainResourceLoader.cpp \
-        Source/WebCore/loader/MainResourceLoader.h \
</del><span class="cx">         Source/WebCore/loader/MixedContentChecker.cpp \
</span><span class="cx">         Source/WebCore/loader/MixedContentChecker.h \
</span><span class="cx">         Source/WebCore/loader/NavigationAction.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreTargetpri"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Target.pri (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Target.pri        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/Target.pri        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -884,7 +884,6 @@
</span><span class="cx">     loader/ImageLoader.cpp \
</span><span class="cx">     loader/LinkLoader.cpp \
</span><span class="cx">     loader/LoaderStrategy.cpp \
</span><del>-    loader/MainResourceLoader.cpp \
</del><span class="cx">     loader/MixedContentChecker.cpp \
</span><span class="cx">     loader/NavigationAction.cpp \
</span><span class="cx">     loader/NetscapePlugInStreamLoader.cpp \
</span><span class="lines">@@ -2082,7 +2081,6 @@
</span><span class="cx">     loader/LinkLoader.h \
</span><span class="cx">     loader/LinkLoaderClient.h \
</span><span class="cx">     loader/LoaderStrategy.h \
</span><del>-    loader/MainResourceLoader.h \
</del><span class="cx">     loader/MixedContentChecker.h \
</span><span class="cx">     loader/NavigationAction.h \
</span><span class="cx">     loader/NetscapePlugInStreamLoader.h \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/WebCore.exp.in        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -278,8 +278,12 @@
</span><span class="cx"> __ZN7WebCore14ClientRectListC1Ev
</span><span class="cx"> __ZN7WebCore14ClientRectListD1Ev
</span><span class="cx"> __ZN7WebCore14DocumentLoader10commitDataEPKcm
</span><ins>+__ZN7WebCore14DocumentLoader12dataReceivedEPNS_14CachedResourceEPKci
</ins><span class="cx"> __ZN7WebCore14DocumentLoader13attachToFrameEv
</span><ins>+__ZN7WebCore14DocumentLoader14notifyFinishedEPNS_14CachedResourceE
</ins><span class="cx"> __ZN7WebCore14DocumentLoader15detachFromFrameEv
</span><ins>+__ZN7WebCore14DocumentLoader16redirectReceivedEPNS_14CachedResourceERNS_15ResourceRequestERKNS_16ResourceResponseE
+__ZN7WebCore14DocumentLoader16responseReceivedEPNS_14CachedResourceERKNS_16ResourceResponseE
</ins><span class="cx"> __ZN7WebCore14DocumentLoader18addArchiveResourceEN3WTF10PassRefPtrINS_15ArchiveResourceEEE
</span><span class="cx"> __ZN7WebCore14ResourceLoader32didCancelAuthenticationChallengeERKNS_23AuthenticationChallengeE
</span><span class="cx"> __ZN7WebCore14cookiesEnabledERKNS_21NetworkStorageSessionERKNS_4KURLES5_
</span><span class="lines">@@ -1296,7 +1300,6 @@
</span><span class="cx"> __ZNK7WebCore14DocumentLoader19isLoadingInAPISenseEv
</span><span class="cx"> __ZNK7WebCore14DocumentLoader19originalRequestCopyEv
</span><span class="cx"> __ZNK7WebCore14DocumentLoader21archiveResourceForURLERKNS_4KURLE
</span><del>-__ZNK7WebCore14DocumentLoader21isLoadingMainResourceEv
</del><span class="cx"> __ZNK7WebCore14DocumentLoader28urlForHistoryReflectsFailureEv
</span><span class="cx"> __ZNK7WebCore14DocumentLoader3urlEv
</span><span class="cx"> __ZNK7WebCore14DocumentMarker11descriptionEv
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoregypi"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.gypi (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.gypi        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/WebCore.gypi        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -2084,8 +2084,6 @@
</span><span class="cx">             'loader/LinkLoaderClient.h',
</span><span class="cx">             'loader/LoaderStrategy.cpp',
</span><span class="cx">             'loader/LoaderStrategy.h',
</span><del>-            'loader/MainResourceLoader.cpp',
-            'loader/MainResourceLoader.h',
</del><span class="cx">             'loader/MixedContentChecker.cpp',
</span><span class="cx">             'loader/MixedContentChecker.h',
</span><span class="cx">             'loader/NavigationAction.cpp',
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcprojWebCorevcproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -28131,14 +28131,6 @@
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span><span class="cx">                         &lt;File
</span><del>-                                RelativePath=&quot;..\loader\MainResourceLoader.cpp&quot;
-                                &gt;
-                        &lt;/File&gt;
-                        &lt;File
-                                RelativePath=&quot;..\loader\MainResourceLoader.h&quot;
-                                &gt;
-                        &lt;/File&gt;
-                        &lt;File
</del><span class="cx">                                 RelativePath=&quot;..\loader\MixedContentChecker.cpp&quot;
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</del><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</ins><span class="cx"> &lt;Project DefaultTargets=&quot;Build&quot; ToolsVersion=&quot;4.0&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;
</span><span class="cx">   &lt;ItemGroup Label=&quot;ProjectConfigurations&quot;&gt;
</span><span class="cx">     &lt;ProjectConfiguration Include=&quot;DebugSuffix|Win32&quot;&gt;
</span><span class="lines">@@ -3993,7 +3993,6 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\ImageLoader.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\LinkLoader.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\LoaderStrategy.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\loader\MainResourceLoader.cpp&quot; /&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\loader\MixedContentChecker.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\NavigationAction.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\NavigationScheduler.cpp&quot; /&gt;
</span><span class="lines">@@ -11490,7 +11489,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\LinkLoader.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\LinkLoaderClient.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\LoaderStrategy.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\loader\MainResourceLoader.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\loader\MixedContentChecker.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\NavigationAction.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\NavigationScheduler.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</del><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</ins><span class="cx"> &lt;Project ToolsVersion=&quot;4.0&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;
</span><span class="cx">   &lt;ItemGroup&gt;
</span><span class="cx">     &lt;Filter Include=&quot;DerivedSources&quot;&gt;
</span><span class="lines">@@ -2274,9 +2274,6 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\LoaderStrategy.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\loader\MainResourceLoader.cpp&quot;&gt;
-      &lt;Filter&gt;loader&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\loader\MixedContentChecker.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -9072,9 +9069,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\LoaderStrategy.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\loader\MainResourceLoader.h&quot;&gt;
-      &lt;Filter&gt;loader&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\loader\MixedContentChecker.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -1827,7 +1827,6 @@
</span><span class="cx">                 656D373C0ADBA5DE00A4554D /* FrameLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37240ADBA5DE00A4554D /* FrameLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 656D373E0ADBA5DE00A4554D /* FrameLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37260ADBA5DE00A4554D /* FrameLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 656D373F0ADBA5DE00A4554D /* ResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37270ADBA5DE00A4554D /* ResourceLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                656D37410ADBA5DE00A4554D /* MainResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37290ADBA5DE00A4554D /* MainResourceLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D372B0ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 656D37480ADBA5DE00A4554D /* SubresourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37300ADBA5DE00A4554D /* SubresourceLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 6571DCC81385E6A400702DD0 /* MemoryPressureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 657EDA071385CB97004E0645 /* MemoryPressureHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3410,7 +3409,6 @@
</span><span class="cx">                 93D3C17D0F97AA760053C013 /* DOMHTMLCanvasElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 93D3C1580F97A9D70053C013 /* DOMHTMLCanvasElement.h */; };
</span><span class="cx">                 93D9D53C0DA27E180077216C /* RangeBoundaryPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D9D53B0DA27E180077216C /* RangeBoundaryPoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 93E227E00AF589AD00D48324 /* DocumentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */; };
</span><del>-                93E227E10AF589AD00D48324 /* MainResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DC0AF589AD00D48324 /* MainResourceLoader.cpp */; };
</del><span class="cx">                 93E227E30AF589AD00D48324 /* ResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DE0AF589AD00D48324 /* ResourceLoader.cpp */; };
</span><span class="cx">                 93E227E40AF589AD00D48324 /* SubresourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */; };
</span><span class="cx">                 93E241FF0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E241FE0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -9322,7 +9320,6 @@
</span><span class="cx">                 656D37240ADBA5DE00A4554D /* FrameLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 656D37260ADBA5DE00A4554D /* FrameLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameLoaderClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 656D37270ADBA5DE00A4554D /* ResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                656D37290ADBA5DE00A4554D /* MainResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MainResourceLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 656D372B0ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NetscapePlugInStreamLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 656D37300ADBA5DE00A4554D /* SubresourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SubresourceLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 657EDA061385CB97004E0645 /* MemoryPressureHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryPressureHandler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -10932,7 +10929,6 @@
</span><span class="cx">                 93D3C1580F97A9D70053C013 /* DOMHTMLCanvasElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLCanvasElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93D9D53B0DA27E180077216C /* RangeBoundaryPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangeBoundaryPoint.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                93E227DC0AF589AD00D48324 /* MainResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainResourceLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 93E227DD0AF589AD00D48324 /* NetscapePlugInStreamLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetscapePlugInStreamLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93E227DE0AF589AD00D48324 /* ResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubresourceLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -21553,8 +21549,6 @@
</span><span class="cx">                                 984264EF12D5280A000D88A4 /* LinkLoaderClient.h */,
</span><span class="cx">                                 51ABF64C16392E2800132A7A /* LoaderStrategy.cpp */,
</span><span class="cx">                                 51E6820F16387302003BBF3C /* LoaderStrategy.h */,
</span><del>-                                93E227DC0AF589AD00D48324 /* MainResourceLoader.cpp */,
-                                656D37290ADBA5DE00A4554D /* MainResourceLoader.h */,
</del><span class="cx">                                 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */,
</span><span class="cx">                                 52F10863162B6D82009AC81E /* MixedContentChecker.h */,
</span><span class="cx">                                 93CCF05F0AF6CA7600018E89 /* NavigationAction.cpp */,
</span><span class="lines">@@ -25564,7 +25558,6 @@
</span><span class="cx">                                 935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */,
</span><span class="cx">                                 BCE1C41B0D982980003B02F2 /* Location.h in Headers */,
</span><span class="cx">                                 A8239E0109B3CF8A00B60641 /* Logging.h in Headers */,
</span><del>-                                656D37410ADBA5DE00A4554D /* MainResourceLoader.h in Headers */,
</del><span class="cx">                                 E187056316E54A0D00585E97 /* MainThreadTask.h in Headers */,
</span><span class="cx">                                 1A8F6BC60DB55CDC001DB794 /* ManifestParser.h in Headers */,
</span><span class="cx">                                 93309DF8099E64920056E581 /* markup.h in Headers */,
</span><span class="lines">@@ -28987,7 +28980,6 @@
</span><span class="cx">                                 BCE1C41C0D982981003B02F2 /* Location.cpp in Sources */,
</span><span class="cx">                                 A8239E0009B3CF8A00B60641 /* Logging.cpp in Sources */,
</span><span class="cx">                                 1402645E0AFDC19B005919E2 /* LoggingMac.mm in Sources */,
</span><del>-                                93E227E10AF589AD00D48324 /* MainResourceLoader.cpp in Sources */,
</del><span class="cx">                                 1A8F6BC50DB55CDC001DB794 /* ManifestParser.cpp in Sources */,
</span><span class="cx">                                 93309DF7099E64920056E581 /* markup.cpp in Sources */,
</span><span class="cx">                                 9728C3131268E4390041E89B /* MarkupAccumulator.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -48,13 +48,13 @@
</span><span class="cx"> #include &quot;HistoryItem.h&quot;
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><del>-#include &quot;MainResourceLoader.h&quot;
</del><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;ProgressTracker.h&quot;
</span><span class="cx"> #include &quot;ResourceBuffer.h&quot;
</span><span class="cx"> #include &quot;SchemeRegistry.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><ins>+#include &quot;SubresourceLoader.h&quot;
</ins><span class="cx"> #include &quot;TextResourceDecoder.h&quot;
</span><span class="cx"> #include &quot;WebCoreMemoryInstrumentation.h&quot;
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="lines">@@ -107,11 +107,11 @@
</span><span class="cx">     , m_gotFirstByte(false)
</span><span class="cx">     , m_isClientRedirect(false)
</span><span class="cx">     , m_isLoadingMultipartContent(false)
</span><del>-    , m_loadingEmptyDocument(false)
</del><span class="cx">     , m_wasOnloadHandled(false)
</span><span class="cx">     , m_stopRecordingResponses(false)
</span><span class="cx">     , m_substituteResourceDeliveryTimer(this, &amp;DocumentLoader::substituteResourceDeliveryTimerFired)
</span><span class="cx">     , m_didCreateGlobalHistoryEntry(false)
</span><ins>+    , m_loadingMainResource(false)
</ins><span class="cx">     , m_timeOfLastDataReceived(0.0)
</span><span class="cx">     , m_identifierForLoadWithoutResourceLoader(0)
</span><span class="cx">     , m_dataLoadTimer(this, &amp;DocumentLoader::handleSubstituteDataLoadNow)
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx"> 
</span><span class="cx"> ResourceLoader* DocumentLoader::mainResourceLoader() const
</span><span class="cx"> {
</span><del>-    return m_mainResourceLoader ? m_mainResourceLoader-&gt;loader() : 0;
</del><ins>+    return m_mainResource ? m_mainResource-&gt;loader() : 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> DocumentLoader::~DocumentLoader()
</span><span class="lines">@@ -140,16 +140,19 @@
</span><span class="cx">     if (m_iconDataCallback)
</span><span class="cx">         m_iconDataCallback-&gt;invalidate();
</span><span class="cx">     m_cachedResourceLoader-&gt;clearDocumentLoader();
</span><ins>+    
+    if (m_mainResource) {
+        m_mainResource-&gt;removeClient(this);
+        m_mainResource = 0;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;ResourceBuffer&gt; DocumentLoader::mainResourceData() const
</span><span class="cx"> {
</span><del>-    if (m_mainResourceData)
-        return m_mainResourceData;
</del><span class="cx">     if (m_substituteData.isValid())
</span><span class="cx">         return ResourceBuffer::create(m_substituteData.content()-&gt;data(), m_substituteData.content()-&gt;size());
</span><del>-    if (m_mainResourceLoader)
-        return m_mainResourceLoader-&gt;resourceData();
</del><ins>+    if (m_mainResource)
+        return m_mainResource-&gt;resourceBuffer();
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -292,7 +295,7 @@
</span><span class="cx"> 
</span><span class="cx">     FrameLoader* frameLoader = DocumentLoader::frameLoader();
</span><span class="cx">     
</span><del>-    if (m_mainResourceLoader)
</del><ins>+    if (isLoadingMainResource())
</ins><span class="cx">         // Stop the main resource loader and let it send the cancelled message.
</span><span class="cx">         cancelMainResourceLoad(frameLoader-&gt;cancelledError(m_request));
</span><span class="cx">     else if (!m_subresourceLoaders.isEmpty())
</span><span class="lines">@@ -330,6 +333,26 @@
</span><span class="cx">     return isLoadingMainResource() || !m_subresourceLoaders.isEmpty() || !m_plugInStreamLoaders.isEmpty();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void DocumentLoader::notifyFinished(CachedResource* resource)
+{
+    ASSERT_UNUSED(resource, m_mainResource == resource);
+    ASSERT(m_mainResource);
+    if (!m_mainResource-&gt;errorOccurred() &amp;&amp; !m_mainResource-&gt;wasCanceled()) {
+        finishedLoading(m_mainResource-&gt;loadFinishTime());
+        return;
+    }
+
+    // FIXME: we should fix the design to eliminate the need for a platform ifdef here
+#if !PLATFORM(CHROMIUM)
+    if (m_request.cachePolicy() == ReturnCacheDataDontLoad &amp;&amp; !m_mainResource-&gt;wasCanceled()) {
+        frameLoader()-&gt;retryAfterFailedCacheOnlyMainResourceLoad();
+        return;
+    }
+#endif
+
+    mainReceivedError(m_mainResource-&gt;resourceError());
+}
+
</ins><span class="cx"> void DocumentLoader::finishedLoading(double finishTime)
</span><span class="cx"> {
</span><span class="cx">     // There is a bug in CFNetwork where callbacks can be dispatched even when loads are deferred.
</span><span class="lines">@@ -351,7 +374,7 @@
</span><span class="cx">         int length;
</span><span class="cx">         const char* data = m_contentFilter-&gt;getReplacementData(length);
</span><span class="cx">         if (data)
</span><del>-            receivedData(data, length);
</del><ins>+            dataReceived(m_mainResource.get(), data, length);
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -385,9 +408,9 @@
</span><span class="cx"> 
</span><span class="cx">     // If the document specified an application cache manifest, it violates the author's intent if we store it in the memory cache
</span><span class="cx">     // and deny the appcache the chance to intercept it in the future, so remove from the memory cache.
</span><del>-    if (frame() &amp;&amp; m_mainResourceLoader) {
-        if (m_mainResourceLoader-&gt;cachedMainResource() &amp;&amp; frame()-&gt;document()-&gt;hasManifest())
-            memoryCache()-&gt;remove(m_mainResourceLoader-&gt;cachedMainResource());
</del><ins>+    if (m_frame) {
+        if (m_mainResource &amp;&amp; m_frame-&gt;document()-&gt;hasManifest())
+            memoryCache()-&gt;remove(m_mainResource.get());
</ins><span class="cx">     }
</span><span class="cx">     m_applicationCacheHost-&gt;finishedLoadingMainResource();
</span><span class="cx"> }
</span><span class="lines">@@ -411,7 +434,7 @@
</span><span class="cx">     if (url.isEmpty())
</span><span class="cx">         url = m_request.url();
</span><span class="cx">     ResourceResponse response(url, m_substituteData.mimeType(), m_substituteData.content()-&gt;size(), m_substituteData.textEncoding(), &quot;&quot;);
</span><del>-    responseReceived(response);
</del><ins>+    responseReceived(0, response);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DocumentLoader::startDataLoadTimer()
</span><span class="lines">@@ -432,6 +455,12 @@
</span><span class="cx">         handleSubstituteDataLoadNow(0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void DocumentLoader::redirectReceived(CachedResource* resource, ResourceRequest&amp; request, const ResourceResponse&amp; redirectResponse)
+{
+    ASSERT_UNUSED(resource, resource == m_mainResource);
+    willSendRequest(request, redirectResponse);
+}
+
</ins><span class="cx"> void DocumentLoader::willSendRequest(ResourceRequest&amp; newRequest, const ResourceResponse&amp; redirectResponse)
</span><span class="cx"> {
</span><span class="cx">     // Note that there are no asserts here as there are for the other callbacks. This is due to the
</span><span class="lines">@@ -515,17 +544,21 @@
</span><span class="cx">         // If the ResourceLoader is indeed cancelled, it would normally send resource load callbacks.
</span><span class="cx">         // However, from an API perspective, this isn't a cancellation. Therefore, sever our relationship with the network load,
</span><span class="cx">         // but prevent the ResourceLoader from sending ResourceLoadNotifier callbacks.
</span><del>-        RefPtr&lt;ResourceLoader&gt; resourceLoader = m_mainResourceLoader-&gt;loader();
</del><ins>+        RefPtr&lt;ResourceLoader&gt; resourceLoader = mainResourceLoader();
</ins><span class="cx">         ASSERT(resourceLoader-&gt;shouldSendResourceLoadCallbacks());
</span><span class="cx">         resourceLoader-&gt;setSendCallbackPolicy(DoNotSendCallbacks);
</span><del>-        m_mainResourceLoader-&gt;clearResource();
</del><ins>+        if (m_mainResource) {
+            m_mainResource-&gt;removeClient(this);
+            m_mainResource = 0;
+        }
</ins><span class="cx">         resourceLoader-&gt;setSendCallbackPolicy(SendCallbacks);
</span><span class="cx">         handleSubstituteDataLoadSoon();
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DocumentLoader::responseReceived(const ResourceResponse&amp; response)
</del><ins>+void DocumentLoader::responseReceived(CachedResource* resource, const ResourceResponse&amp; response)
</ins><span class="cx"> {
</span><ins>+    ASSERT_UNUSED(resource, m_mainResource == resource);
</ins><span class="cx">     RefPtr&lt;DocumentLoader&gt; protect(this);
</span><span class="cx">     bool willLoadFallback = m_applicationCacheHost-&gt;maybeLoadFallbackForMainResponse(request(), response);
</span><span class="cx"> 
</span><span class="lines">@@ -539,7 +572,7 @@
</span><span class="cx">         shouldRemoveResourceFromCache = true;
</span><span class="cx"> #endif
</span><span class="cx">     if (shouldRemoveResourceFromCache)
</span><del>-        memoryCache()-&gt;remove(m_mainResourceLoader-&gt;cachedMainResource());
</del><ins>+        memoryCache()-&gt;remove(m_mainResource.get());
</ins><span class="cx"> 
</span><span class="cx">     if (willLoadFallback)
</span><span class="cx">         return;
</span><span class="lines">@@ -566,7 +599,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_isLoadingMultipartContent) {
</span><span class="cx">         setupForReplace();
</span><del>-        m_mainResourceLoader-&gt;cachedMainResource()-&gt;clear();
</del><ins>+        m_mainResource-&gt;clear();
</ins><span class="cx">     } else if (response.isMultipart()) {
</span><span class="cx">         FeatureObserver::observe(m_frame-&gt;document(), FeatureObserver::MultipartMainResource);
</span><span class="cx">         m_isLoadingMultipartContent = true;
</span><span class="lines">@@ -637,8 +670,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     case PolicyDownload: {
</span><del>-        // The main CachedResource can be null, e.g. when loading a substitute resource from application cache.
-        if (!m_mainResourceLoader-&gt;cachedMainResource()) {
</del><ins>+        // m_mainResource can be null, e.g. when loading a substitute resource from application cache.
+        if (!m_mainResource) {
</ins><span class="cx">             mainReceivedError(frameLoader()-&gt;client()-&gt;cannotShowURLError(m_request));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -679,7 +712,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!isStopping() &amp;&amp; m_substituteData.isValid()) {
</span><span class="cx">         if (m_substituteData.content()-&gt;size())
</span><del>-            receivedData(m_substituteData.content()-&gt;data(), m_substituteData.content()-&gt;size());
</del><ins>+            dataReceived(0, m_substituteData.content()-&gt;data(), m_substituteData.content()-&gt;size());
</ins><span class="cx">         if (isLoadingMainResource())
</span><span class="cx">             finishedLoading(0);
</span><span class="cx">     }
</span><span class="lines">@@ -758,8 +791,7 @@
</span><span class="cx">     MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader);
</span><span class="cx">     info.addMember(m_frame, &quot;frame&quot;);
</span><span class="cx">     info.addMember(m_cachedResourceLoader, &quot;cachedResourceLoader&quot;);
</span><del>-    info.addMember(m_mainResourceLoader, &quot;mainResourceLoader&quot;);
-    info.addMember(m_mainResourceData, &quot;mainResourceData&quot;);
</del><ins>+    info.addMember(m_mainResource, &quot;mainResource&quot;);
</ins><span class="cx">     info.addMember(m_subresourceLoaders, &quot;subresourceLoaders&quot;);
</span><span class="cx">     info.addMember(m_multipartSubresourceLoaders, &quot;multipartSubresourceLoaders&quot;);
</span><span class="cx">     info.addMember(m_plugInStreamLoaders, &quot;plugInStreamLoaders&quot;);
</span><span class="lines">@@ -788,10 +820,11 @@
</span><span class="cx">     info.addMember(m_applicationCacheHost, &quot;applicationCacheHost&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DocumentLoader::receivedData(const char* data, int length)
</del><ins>+void DocumentLoader::dataReceived(CachedResource* resource, const char* data, int length)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(data);
</span><span class="cx">     ASSERT(length);
</span><ins>+    ASSERT_UNUSED(resource, resource == m_mainResource);
</ins><span class="cx">     ASSERT(!m_response.isNull());
</span><span class="cx"> 
</span><span class="cx"> #if USE(CFNETWORK) || PLATFORM(MAC)
</span><span class="lines">@@ -901,12 +934,7 @@
</span><span class="cx"> 
</span><span class="cx"> void DocumentLoader::clearMainResourceLoader()
</span><span class="cx"> {
</span><del>-    if (m_mainResourceLoader) {
-        m_mainResourceData = m_mainResourceLoader-&gt;resourceData();
-        m_mainResourceLoader = 0;
-    }
-    m_loadingEmptyDocument = false;
-
</del><ins>+    m_loadingMainResource = false;
</ins><span class="cx">     if (this == frameLoader()-&gt;activeDocumentLoader())
</span><span class="cx">         checkLoadComplete();
</span><span class="cx"> }
</span><span class="lines">@@ -1243,8 +1271,8 @@
</span><span class="cx"> 
</span><span class="cx"> void DocumentLoader::setDefersLoading(bool defers)
</span><span class="cx"> {
</span><del>-    if (m_mainResourceLoader)
-        m_mainResourceLoader-&gt;setDefersLoading(defers);
</del><ins>+    if (mainResourceLoader())
+        mainResourceLoader()-&gt;setDefersLoading(defers);
</ins><span class="cx">     setAllDefersLoading(m_subresourceLoaders, defers);
</span><span class="cx">     setAllDefersLoading(m_plugInStreamLoaders, defers);
</span><span class="cx">     if (!defers)
</span><span class="lines">@@ -1253,8 +1281,8 @@
</span><span class="cx"> 
</span><span class="cx"> void DocumentLoader::setMainResourceDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy)
</span><span class="cx"> {
</span><del>-    if (m_mainResourceLoader)
-        m_mainResourceLoader-&gt;setDataBufferingPolicy(dataBufferingPolicy);
</del><ins>+    if (m_mainResource)
+        m_mainResource-&gt;setDataBufferingPolicy(dataBufferingPolicy);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DocumentLoader::stopLoadingPlugIns()
</span><span class="lines">@@ -1271,13 +1299,13 @@
</span><span class="cx"> {
</span><span class="cx">     // The main resource's underlying ResourceLoader will ask to be added here.
</span><span class="cx">     // It is much simpler to handle special casing of main resource loads if we don't
</span><del>-    // let it be added. In the main resource load case, m_mainResourceLoader-&gt;loader()
</del><ins>+    // let it be added. In the main resource load case, mainResourceLoader()
</ins><span class="cx">     // will still be null at this point, but m_gotFirstByte should be false here if and only
</span><span class="cx">     // if we are just starting the main resource load.
</span><span class="cx">     if (!m_gotFirstByte)
</span><span class="cx">         return;
</span><span class="cx">     ASSERT(!m_subresourceLoaders.contains(loader));
</span><del>-    ASSERT(!m_mainResourceLoader || m_mainResourceLoader-&gt;loader() != loader);
</del><ins>+    ASSERT(!mainResourceLoader() || mainResourceLoader() != loader);
</ins><span class="cx">     m_subresourceLoaders.add(loader);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1302,11 +1330,6 @@
</span><span class="cx">     checkLoadComplete();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool DocumentLoader::isLoadingMainResource() const
-{
-    return !!m_mainResourceLoader || m_loadingEmptyDocument;
-}
-
</del><span class="cx"> bool DocumentLoader::isMultipartReplacingLoad() const
</span><span class="cx"> {
</span><span class="cx">     return isLoadingMultipartContent() &amp;&amp; frameLoader()-&gt;isReplacing();
</span><span class="lines">@@ -1318,7 +1341,6 @@
</span><span class="cx">     if (!shouldLoadEmpty &amp;&amp; !frameLoader()-&gt;client()-&gt;representationExistsForURLScheme(m_request.url().protocol()))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    m_loadingEmptyDocument = true;
</del><span class="cx">     if (m_request.url().isEmpty() &amp;&amp; !frameLoader()-&gt;stateMachine()-&gt;creatingInitialEmptyDocument())
</span><span class="cx">         m_request.setURL(blankURL());
</span><span class="cx">     String mimeType = shouldLoadEmpty ? &quot;text/html&quot; : frameLoader()-&gt;client()-&gt;generatedMIMETypeForURLScheme(m_request.url().protocol());
</span><span class="lines">@@ -1331,13 +1353,13 @@
</span><span class="cx"> {
</span><span class="cx">     m_mainDocumentError = ResourceError();
</span><span class="cx">     timing()-&gt;markNavigationStart();
</span><del>-    ASSERT(!m_mainResourceLoader);
</del><ins>+    ASSERT(!m_mainResource);
+    ASSERT(!m_loadingMainResource);
+    m_loadingMainResource = true;
</ins><span class="cx"> 
</span><span class="cx">     if (maybeLoadEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_mainResourceLoader = MainResourceLoader::create(this);
-
</del><span class="cx">     // FIXME: Is there any way the extra fields could have not been added by now?
</span><span class="cx">     // If not, it would be great to remove this line of code.
</span><span class="cx">     // Note that currently, some requests may have incorrect extra fields even if this function has been called,
</span><span class="lines">@@ -1364,10 +1386,12 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ResourceRequest request(m_request);
</span><del>-    m_mainResourceLoader-&gt;load(m_request);
-
-    if (m_request.isNull()) {
-        m_mainResourceLoader = 0;
</del><ins>+    DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions,
+        (SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck));
+    CachedResourceRequest cachedResourceRequest(request, mainResourceLoadOptions);
+    m_mainResource = m_cachedResourceLoader-&gt;requestMainResource(cachedResourceRequest);
+    if (!m_mainResource) {
+        setRequest(ResourceRequest());
</ins><span class="cx">         // If the load was aborted by clearing m_request, it's possible the ApplicationCacheHost
</span><span class="cx">         // is now in a state where starting an empty load will be inconsistent. Replace it with
</span><span class="cx">         // a new ApplicationCacheHost.
</span><span class="lines">@@ -1381,6 +1405,7 @@
</span><span class="cx">         frameLoader()-&gt;notifier()-&gt;assignIdentifierToInitialRequest(m_identifierForLoadWithoutResourceLoader, this, request);
</span><span class="cx">         frameLoader()-&gt;notifier()-&gt;dispatchWillSendRequest(this, m_identifierForLoadWithoutResourceLoader, request, ResourceResponse());
</span><span class="cx">     }
</span><ins>+    m_mainResource-&gt;addClient(this);
</ins><span class="cx"> 
</span><span class="cx">     // A bunch of headers are set when the underlying ResourceLoader is created, and m_request needs to include those.
</span><span class="cx">     if (mainResourceLoader())
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.h (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.h        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/loader/DocumentLoader.h        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -30,6 +30,8 @@
</span><span class="cx"> #ifndef DocumentLoader_h
</span><span class="cx"> #define DocumentLoader_h
</span><span class="cx"> 
</span><ins>+#include &quot;CachedRawResource.h&quot;
+#include &quot;CachedResourceHandle.h&quot;
</ins><span class="cx"> #include &quot;DocumentLoadTiming.h&quot;
</span><span class="cx"> #include &quot;DocumentWriter.h&quot;
</span><span class="cx"> #include &quot;IconDatabaseBase.h&quot;
</span><span class="lines">@@ -65,7 +67,6 @@
</span><span class="cx">     class FormState;
</span><span class="cx">     class Frame;
</span><span class="cx">     class FrameLoader;
</span><del>-    class MainResourceLoader;
</del><span class="cx">     class Page;
</span><span class="cx">     class ResourceBuffer;
</span><span class="cx">     class ResourceLoader;
</span><span class="lines">@@ -75,7 +76,8 @@
</span><span class="cx">     typedef HashSet&lt;RefPtr&lt;ResourceLoader&gt; &gt; ResourceLoaderSet;
</span><span class="cx">     typedef Vector&lt;ResourceResponse&gt; ResponseVector;
</span><span class="cx"> 
</span><del>-    class DocumentLoader : public RefCounted&lt;DocumentLoader&gt; {
</del><ins>+    class DocumentLoader : public RefCounted&lt;DocumentLoader&gt;, private CachedRawResourceClient {
+        WTF_MAKE_FAST_ALLOCATED;
</ins><span class="cx">     public:
</span><span class="cx">         static PassRefPtr&lt;DocumentLoader&gt; create(const ResourceRequest&amp; request, const SubstituteData&amp; data)
</span><span class="cx">         {
</span><span class="lines">@@ -214,8 +216,8 @@
</span><span class="cx">         void continueIconLoadWithDecision(IconLoadDecision);
</span><span class="cx">         void getIconLoadDecisionForIconURL(const String&amp;);
</span><span class="cx">         void getIconDataForIconURL(const String&amp;);
</span><del>-        
-        bool isLoadingMainResource() const;
</del><ins>+
+        bool isLoadingMainResource() const { return m_loadingMainResource; }
</ins><span class="cx">         bool isLoadingMultipartContent() const { return m_isLoadingMultipartContent; }
</span><span class="cx"> 
</span><span class="cx">         void stopLoadingPlugIns();
</span><span class="lines">@@ -262,9 +264,6 @@
</span><span class="cx">         virtual void reportMemoryUsage(MemoryObjectInfo*) const;
</span><span class="cx">         void checkLoadComplete();
</span><span class="cx"> 
</span><del>-        // FIXME: This should be private once DocumentLoader and MainResourceLoader are merged.
-        void willSendRequest(ResourceRequest&amp;, const ResourceResponse&amp;);
-
</del><span class="cx">     protected:
</span><span class="cx">         DocumentLoader(const ResourceRequest&amp;, const SubstituteData&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -281,6 +280,12 @@
</span><span class="cx">         void clearArchiveResources();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+        void willSendRequest(ResourceRequest&amp;, const ResourceResponse&amp;);
+        virtual void redirectReceived(CachedResource*, ResourceRequest&amp;, const ResourceResponse&amp;) OVERRIDE;
+        virtual void responseReceived(CachedResource*, const ResourceResponse&amp;) OVERRIDE;
+        virtual void dataReceived(CachedResource*, const char* data, int length) OVERRIDE;
+        virtual void notifyFinished(CachedResource*) OVERRIDE;
+
</ins><span class="cx">         bool maybeLoadEmpty();
</span><span class="cx"> 
</span><span class="cx">         bool isMultipartReplacingLoad() const;
</span><span class="lines">@@ -310,12 +315,10 @@
</span><span class="cx">         Frame* m_frame;
</span><span class="cx">         RefPtr&lt;CachedResourceLoader&gt; m_cachedResourceLoader;
</span><span class="cx"> 
</span><del>-        RefPtr&lt;MainResourceLoader&gt; m_mainResourceLoader;
</del><ins>+        CachedResourceHandle&lt;CachedRawResource&gt; m_mainResource;
</ins><span class="cx">         ResourceLoaderSet m_subresourceLoaders;
</span><span class="cx">         ResourceLoaderSet m_multipartSubresourceLoaders;
</span><span class="cx">         ResourceLoaderSet m_plugInStreamLoaders;
</span><del>-
-        RefPtr&lt;ResourceBuffer&gt; m_mainResourceData;
</del><span class="cx">         
</span><span class="cx">         mutable DocumentWriter m_writer;
</span><span class="cx"> 
</span><span class="lines">@@ -345,7 +348,6 @@
</span><span class="cx">         bool m_gotFirstByte;
</span><span class="cx">         bool m_isClientRedirect;
</span><span class="cx">         bool m_isLoadingMultipartContent;
</span><del>-        bool m_loadingEmptyDocument;
</del><span class="cx"> 
</span><span class="cx">         // FIXME: Document::m_processingLoadEvent and DocumentLoader::m_wasOnloadHandled are roughly the same
</span><span class="cx">         // and should be merged.
</span><span class="lines">@@ -385,6 +387,7 @@
</span><span class="cx">         String m_clientRedirectSourceForHistory;
</span><span class="cx">         bool m_didCreateGlobalHistoryEntry;
</span><span class="cx"> 
</span><ins>+        bool m_loadingMainResource;
</ins><span class="cx">         DocumentLoadTiming m_documentLoadTiming;
</span><span class="cx"> 
</span><span class="cx">         double m_timeOfLastDataReceived;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderMainResourceLoadercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/loader/MainResourceLoader.cpp (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/MainResourceLoader.cpp        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/loader/MainResourceLoader.cpp        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -1,197 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;MainResourceLoader.h&quot;
-
-#include &quot;ApplicationCacheHost.h&quot;
-#include &quot;BackForwardController.h&quot;
-#include &quot;CachedRawResource.h&quot;
-#include &quot;CachedResourceLoader.h&quot;
-#include &quot;CachedResourceRequest.h&quot;
-#include &quot;Console.h&quot;
-#include &quot;DOMWindow.h&quot;
-#include &quot;Document.h&quot;
-#include &quot;DocumentLoadTiming.h&quot;
-#include &quot;DocumentLoader.h&quot;
-#include &quot;FeatureObserver.h&quot;
-#include &quot;Frame.h&quot;
-#include &quot;FrameLoader.h&quot;
-#include &quot;FrameLoaderClient.h&quot;
-#include &quot;HTMLFormElement.h&quot;
-#include &quot;HistoryItem.h&quot;
-#include &quot;InspectorInstrumentation.h&quot;
-#include &quot;MemoryCache.h&quot;
-#include &quot;Page.h&quot;
-#include &quot;ProgressTracker.h&quot;
-#include &quot;ResourceBuffer.h&quot;
-#include &quot;ResourceError.h&quot;
-#include &quot;ResourceHandle.h&quot;
-#include &quot;SchemeRegistry.h&quot;
-#include &quot;SecurityOrigin.h&quot;
-#include &quot;Settings.h&quot;
-#include &quot;SubresourceLoader.h&quot;
-#include &lt;wtf/CurrentTime.h&gt;
-
-#if PLATFORM(QT)
-#include &quot;PluginDatabase.h&quot;
-#endif
-
-namespace WebCore {
-
-MainResourceLoader::MainResourceLoader(DocumentLoader* documentLoader)
-    : m_documentLoader(documentLoader)
-{
-}
-
-MainResourceLoader::~MainResourceLoader()
-{
-    clearResource();
-}
-
-PassRefPtr&lt;MainResourceLoader&gt; MainResourceLoader::create(DocumentLoader* documentLoader)
-{
-    return adoptRef(new MainResourceLoader(documentLoader));
-}
-
-void MainResourceLoader::clearResource()
-{
-    if (m_resource) {
-        m_resource-&gt;removeClient(this);
-        m_resource = 0;
-    }
-}
-
-FrameLoader* MainResourceLoader::frameLoader() const
-{
-    return m_documentLoader-&gt;frameLoader();
-}
-
-const ResourceRequest&amp; MainResourceLoader::request() const
-{
-    return m_resource ? m_resource-&gt;resourceRequest() : m_initialRequest;
-}
-
-PassRefPtr&lt;ResourceBuffer&gt; MainResourceLoader::resourceData()
-{
-    if (m_resource)
-        return m_resource-&gt;resourceBuffer();
-    return 0;
-}
-
-void MainResourceLoader::redirectReceived(CachedResource* resource, ResourceRequest&amp; request, const ResourceResponse&amp; redirectResponse)
-{
-    ASSERT_UNUSED(resource, resource == m_resource);
-    m_documentLoader-&gt;willSendRequest(request, redirectResponse);
-}
-
-void MainResourceLoader::responseReceived(CachedResource* resource, const ResourceResponse&amp; r)
-{
-    ASSERT_UNUSED(resource, m_resource == resource);
-    m_documentLoader-&gt;responseReceived(r);
-}
-
-void MainResourceLoader::dataReceived(CachedResource* resource, const char* data, int length)
-{
-    ASSERT_UNUSED(resource, resource == m_resource);
-    documentLoader()-&gt;receivedData(data, length);
-}
-
-void MainResourceLoader::notifyFinished(CachedResource* resource)
-{
-    ASSERT_UNUSED(resource, m_resource == resource);
-    ASSERT(m_resource);
-    if (!m_resource-&gt;errorOccurred() &amp;&amp; !m_resource-&gt;wasCanceled()) {
-        documentLoader()-&gt;finishedLoading(m_resource-&gt;loadFinishTime());
-        return;
-    }
-
-    // FIXME: we should fix the design to eliminate the need for a platform ifdef here
-#if !PLATFORM(CHROMIUM)
-    if (m_documentLoader-&gt;request().cachePolicy() == ReturnCacheDataDontLoad &amp;&amp; !m_resource-&gt;wasCanceled()) {
-        frameLoader()-&gt;retryAfterFailedCacheOnlyMainResourceLoad();
-        return;
-    }
-#endif
-    m_documentLoader-&gt;mainReceivedError(m_resource-&gt;resourceError());
-}
-
-void MainResourceLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
-{
-    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Loader);
-    info.addMember(m_resource, &quot;resource&quot;);
-    info.addMember(m_initialRequest, &quot;initialRequest&quot;);
-    info.addMember(m_documentLoader, &quot;documentLoader&quot;);
-}
-
-void MainResourceLoader::load(const ResourceRequest&amp; initialRequest)
-{
-    ResourceRequest request(initialRequest);
-
-    DEFINE_STATIC_LOCAL(ResourceLoaderOptions, mainResourceLoadOptions,
-        (SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck));
-    CachedResourceRequest cachedResourceRequest(request, mainResourceLoadOptions);
-    m_resource = documentLoader()-&gt;cachedResourceLoader()-&gt;requestMainResource(cachedResourceRequest);
-    if (!m_resource) {
-        documentLoader()-&gt;setRequest(ResourceRequest());
-        return;
-    }
-    m_resource-&gt;addClient(this);
-}
-
-void MainResourceLoader::setDefersLoading(bool defers)
-{
-    if (loader())
-        loader()-&gt;setDefersLoading(defers);
-}
-
-bool MainResourceLoader::defersLoading() const
-{
-    return loader() ? loader()-&gt;defersLoading() : false;
-}
-
-void MainResourceLoader::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy)
-{
-    if (m_resource)
-        m_resource-&gt;setDataBufferingPolicy(dataBufferingPolicy);
-}
-
-ResourceLoader* MainResourceLoader::loader() const
-{ 
-    return m_resource ? m_resource-&gt;loader() : 0;
-}
-
-unsigned long MainResourceLoader::identifier() const
-{
-    if (ResourceLoader* resourceLoader = loader())
-        return resourceLoader-&gt;identifier();
-    return 0;
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreloaderMainResourceLoaderh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/loader/MainResourceLoader.h (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/MainResourceLoader.h        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/loader/MainResourceLoader.h        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -1,88 +0,0 @@
</span><del>-/*
- * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef MainResourceLoader_h
-#define MainResourceLoader_h
-
-#include &quot;CachedRawResource.h&quot;
-#include &quot;CachedResourceHandle.h&quot;
-#include &quot;FrameLoaderTypes.h&quot;
-#include &quot;ResourceLoader.h&quot;
-#include &quot;SubstituteData.h&quot;
-#include &lt;wtf/Forward.h&gt;
-
-namespace WebCore {
-
-class ResourceRequest;
-
-class MainResourceLoader : public RefCounted&lt;MainResourceLoader&gt;, public CachedRawResourceClient {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    static PassRefPtr&lt;MainResourceLoader&gt; create(DocumentLoader*);
-    virtual ~MainResourceLoader();
-
-    void load(const ResourceRequest&amp;);
-    ResourceLoader* loader() const;
-    PassRefPtr&lt;ResourceBuffer&gt; resourceData();
-
-    void setDefersLoading(bool);
-    void setDataBufferingPolicy(DataBufferingPolicy);
-
-    CachedRawResource* cachedMainResource() { return m_resource.get(); }
-
-    unsigned long identifier() const;
-
-    void reportMemoryUsage(MemoryObjectInfo*) const;
-
-    void clearResource();
-
-private:
-    explicit MainResourceLoader(DocumentLoader*);
-
-    virtual void redirectReceived(CachedResource*, ResourceRequest&amp;, const ResourceResponse&amp;) OVERRIDE;
-    virtual void responseReceived(CachedResource*, const ResourceResponse&amp;) OVERRIDE;
-    virtual void dataReceived(CachedResource*, const char* data, int dataLength) OVERRIDE;
-    virtual void notifyFinished(CachedResource*) OVERRIDE;
-
-    FrameLoader* frameLoader() const;
-    DocumentLoader* documentLoader() const { return m_documentLoader.get(); }
-
-    const ResourceRequest&amp; request() const;
-
-    bool defersLoading() const;
-
-    CachedResourceHandle&lt;CachedRawResource&gt; m_resource;
-
-    ResourceRequest m_initialRequest;
-
-    RefPtr&lt;DocumentLoader&gt; m_documentLoader;
-};
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreloadermacDocumentLoaderMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/mac/DocumentLoaderMac.cpp (146448 => 146449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/mac/DocumentLoaderMac.cpp        2013-03-21 08:02:10 UTC (rev 146448)
+++ trunk/Source/WebCore/loader/mac/DocumentLoaderMac.cpp        2013-03-21 09:05:45 UTC (rev 146449)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><del>-#include &quot;MainResourceLoader.h&quot;
</del><span class="cx"> #include &quot;ResourceHandle.h&quot;
</span><span class="cx"> #include &quot;ResourceLoader.h&quot;
</span><span class="cx"> #include &lt;wtf/UnusedParam.h&gt;
</span><span class="lines">@@ -55,8 +54,8 @@
</span><span class="cx"> 
</span><span class="cx"> void DocumentLoader::schedule(SchedulePair* pair)
</span><span class="cx"> {
</span><del>-    if (m_mainResourceLoader &amp;&amp; m_mainResourceLoader-&gt;loader() &amp;&amp; m_mainResourceLoader-&gt;loader()-&gt;handle())
-        m_mainResourceLoader-&gt;loader()-&gt;handle()-&gt;schedule(pair);
</del><ins>+    if (mainResourceLoader() &amp;&amp; mainResourceLoader()-&gt;handle())
+        mainResourceLoader()-&gt;handle()-&gt;schedule(pair);
</ins><span class="cx">     scheduleAll(m_subresourceLoaders, pair);
</span><span class="cx">     scheduleAll(m_plugInStreamLoaders, pair);
</span><span class="cx">     scheduleAll(m_multipartSubresourceLoaders, pair);
</span><span class="lines">@@ -64,8 +63,8 @@
</span><span class="cx"> 
</span><span class="cx"> void DocumentLoader::unschedule(SchedulePair* pair)
</span><span class="cx"> {
</span><del>-    if (m_mainResourceLoader &amp;&amp; m_mainResourceLoader-&gt;loader() &amp;&amp; m_mainResourceLoader-&gt;loader()-&gt;handle())
-        m_mainResourceLoader-&gt;loader()-&gt;handle()-&gt;unschedule(pair);
</del><ins>+    if (mainResourceLoader() &amp;&amp; mainResourceLoader()-&gt;handle())
+        mainResourceLoader()-&gt;handle()-&gt;unschedule(pair);
</ins><span class="cx">     unscheduleAll(m_subresourceLoaders, pair);
</span><span class="cx">     unscheduleAll(m_plugInStreamLoaders, pair);
</span><span class="cx">     unscheduleAll(m_multipartSubresourceLoaders, pair);
</span></span></pre>
</div>
</div>

</body>
</html>