Index: Source/core/loader/DocumentLoader.cpp |
diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp |
index 235ef45b884323dbe693b305f73e7519b47df661..ebb7898a890484284e486481b26e24df0599850b 100644 |
--- a/Source/core/loader/DocumentLoader.cpp |
+++ b/Source/core/loader/DocumentLoader.cpp |
@@ -219,7 +219,8 @@ void DocumentLoader::stopLoading() |
RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame.get()); |
RefPtrWillBeRawPtr<DocumentLoader> protectLoader(this); |
- m_fetcher->stopFetching(); |
+ if (m_fetcher) |
+ m_fetcher->stopFetching(); |
if (isLoading()) |
cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); |
} |
@@ -237,7 +238,7 @@ bool DocumentLoader::isLoading() const |
if (document() && document()->hasActiveParser()) |
return true; |
- return m_loadingMainResource || m_fetcher->isFetching(); |
+ return m_loadingMainResource || (m_fetcher && m_fetcher->isFetching()); |
} |
void DocumentLoader::notifyFinished(Resource* resource) |
@@ -601,7 +602,10 @@ void DocumentLoader::detachFromFrame() |
if (!m_frame) |
return; |
- m_fetcher->clearContext(); |
+ if (m_fetcher) |
+ m_fetcher->clearContext(); |
+ m_fetcher.clear(); |
+ |
m_applicationCacheHost->detachFromDocumentLoader(); |
m_applicationCacheHost.clear(); |
WeakIdentifierMap<DocumentLoader>::notifyObjectDestroyed(this); |
@@ -640,7 +644,8 @@ bool DocumentLoader::maybeCreateArchive() |
return false; |
} |
- m_fetcher->addAllArchiveResources(m_archive.get()); |
+ if (m_fetcher) |
sof
2015/06/26 07:21:45
Trying to understand; could you explain why the m_
peria
2015/06/26 07:31:43
No theoretical backgroud. :(
I'm just looking if t
sof
2015/06/29 13:29:29
I can't see much going wrong when I revert those c
sof
2015/06/29 15:00:47
Having looked at that test failure some, I'm wonde
peria
2015/06/30 07:14:39
Yes, we need this check in Document::finishedParsi
|
+ m_fetcher->addAllArchiveResources(m_archive.get()); |
ArchiveResource* mainResource = m_archive->mainResource(); |
// The origin is the MHTML file, we need to set the base URL to the document encoded in the MHTML so |
@@ -667,7 +672,8 @@ void DocumentLoader::prepareSubframeArchiveLoadIfNeeded() |
if (!m_archive) |
return; |
- m_fetcher->addAllArchiveResources(m_archive.get()); |
+ if (m_fetcher) |
+ m_fetcher->addAllArchiveResources(m_archive.get()); |
ArchiveResource* mainResource = m_archive->mainResource(); |
m_substituteData = SubstituteData(mainResource->data(), mainResource->mimeType(), mainResource->textEncoding(), KURL()); |
@@ -691,7 +697,8 @@ void DocumentLoader::setDefersLoading(bool defers) |
if (mainResourceLoader() && mainResourceLoader()->isLoadedBy(m_fetcher.get())) |
mainResourceLoader()->setDefersLoading(defers); |
- m_fetcher->setDefersLoading(defers); |
+ if (m_fetcher) |
+ m_fetcher->setDefersLoading(defers); |
} |
bool DocumentLoader::maybeLoadEmpty() |
@@ -778,7 +785,8 @@ void DocumentLoader::attachThreadedDataReceiver(PassRefPtrWillBeRawPtr<ThreadedD |
void DocumentLoader::acceptDataFromThreadedReceiver(const char* data, int dataLength, int encodedDataLength) |
{ |
- m_fetcher->acceptDataFromThreadedReceiver(mainResourceIdentifier(), data, dataLength, encodedDataLength); |
+ if (m_fetcher) |
+ m_fetcher->acceptDataFromThreadedReceiver(mainResourceIdentifier(), data, dataLength, encodedDataLength); |
} |
void DocumentLoader::endWriting(DocumentWriter* writer) |