Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1031)

Unified Diff: Source/core/loader/DocumentLoader.cpp

Issue 14995003: Move the remainder of Archive loading from FrameLoader to DocumentLoader. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/loader/DocumentLoader.h ('k') | Source/core/loader/FrameLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentLoader.cpp
diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp
index c5dbd81bee9313d410e27146666535a8dd3e82f3..3bb6bc12e553dd7582c8914acb5d3ee8c7cfff8c 100644
--- a/Source/core/loader/DocumentLoader.cpp
+++ b/Source/core/loader/DocumentLoader.cpp
@@ -803,27 +803,31 @@ bool DocumentLoader::maybeCreateArchive()
return true;
}
-void DocumentLoader::setArchive(PassRefPtr<MHTMLArchive> archive)
-{
- m_archive = archive;
- addAllArchiveResources(m_archive.get());
-}
-
void DocumentLoader::addAllArchiveResources(MHTMLArchive* archive)
{
+ ASSERT(archive);
if (!m_archiveResourceCollection)
m_archiveResourceCollection = adoptPtr(new ArchiveResourceCollection);
-
- ASSERT(archive);
- if (!archive)
- return;
-
m_archiveResourceCollection->addAllResources(archive);
}
-PassRefPtr<MHTMLArchive> DocumentLoader::popArchiveForSubframe(const String& frameName, const KURL& url)
+void DocumentLoader::prepareSubframeArchiveLoadIfNeeded()
{
- return m_archiveResourceCollection ? m_archiveResourceCollection->popSubframeArchive(frameName, url) : PassRefPtr<MHTMLArchive>(0);
+ if (!m_frame->tree()->parent())
+ return;
+
+ ArchiveResourceCollection* parentCollection = m_frame->tree()->parent()->loader()->documentLoader()->m_archiveResourceCollection.get();
+ if (!parentCollection)
+ return;
+
+ m_archive = parentCollection->popSubframeArchive(m_frame->tree()->uniqueName(), m_request.url());
+
+ if (!m_archive)
+ return;
+ addAllArchiveResources(m_archive.get());
+
+ ArchiveResource* mainResource = m_archive->mainResource();
+ m_substituteData = SubstituteData(mainResource->data(), mainResource->mimeType(), mainResource->textEncoding(), KURL());
}
void DocumentLoader::clearArchiveResources()
@@ -1059,6 +1063,7 @@ void DocumentLoader::startLoadingMainResource()
return;
m_applicationCacheHost->willStartLoadingMainResource(m_request);
+ prepareSubframeArchiveLoadIfNeeded();
if (m_substituteData.isValid()) {
m_identifierForLoadWithoutResourceLoader = createUniqueIdentifier();
« no previous file with comments | « Source/core/loader/DocumentLoader.h ('k') | Source/core/loader/FrameLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698