summaryrefslogtreecommitdiffstats
path: root/WebCore/loader/SubresourceLoader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/loader/SubresourceLoader.cpp')
-rw-r--r--WebCore/loader/SubresourceLoader.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/WebCore/loader/SubresourceLoader.cpp b/WebCore/loader/SubresourceLoader.cpp
index 4a339ef..047cc6d 100644
--- a/WebCore/loader/SubresourceLoader.cpp
+++ b/WebCore/loader/SubresourceLoader.cpp
@@ -66,7 +66,7 @@ PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, Subresourc
return 0;
FrameLoader* fl = frame->loader();
- if (!skipCanLoadCheck && fl->state() == FrameStateProvisional)
+ if (!skipCanLoadCheck && (fl->state() == FrameStateProvisional || fl->activeDocumentLoader()->isStopping()))
return 0;
ResourceRequest newRequest = request;
@@ -222,6 +222,13 @@ void SubresourceLoader::didCancel(const ResourceError& error)
if (cancelled())
return;
+
+ // The only way the subresource loader can reach the terminal state here is if the run loop spins when calling
+ // m_client->didFail. This should in theory not happen which is why the assert is here.
+ ASSERT(!reachedTerminalState());
+ if (reachedTerminalState())
+ return;
+
m_documentLoader->removeSubresourceLoader(this);
ResourceLoader::didCancel(error);
}