< prev index next >
modules/web/src/main/native/Source/WebCore/loader/cache/CachedResourceLoader.cpp
Print this page
@@ -288,10 +288,14 @@
FrameLoader::reportLocalLoadFailed(frame(), url.stringCenterEllipsizedToLength());
LOG(ResourceLoading, "CachedResourceLoader::requestResource URL was not allowed by SecurityOrigin::canDisplay");
return 0;
}
+ // Don't load for user cancel or stop
+ if (m_documentLoader && !m_documentLoader->mainDocumentError().isNull() && m_documentLoader->mainDocumentError().isCancellation())
+ return false;
+
// FIXME: Convert this to check the isolated world's Content Security Policy once webkit.org/b/104520 is solved.
bool shouldBypassMainWorldContentSecurityPolicy = (frame() && frame()->script().shouldBypassMainWorldContentSecurityPolicy());
// 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
@@ -779,10 +783,15 @@
void CachedResourceLoader::performPostLoadActions()
{
checkForPendingPreloads();
+ // PostLoad might trigger async resource request which is not required for Canceled Main Document
+ // caused by user cancel or stop
+ if (m_documentLoader && !m_documentLoader->mainDocumentError().isNull() && m_documentLoader->mainDocumentError().isCancellation())
+ return;
+
platformStrategies()->loaderStrategy()->resourceLoadScheduler()->servePendingRequests();
}
void CachedResourceLoader::incrementRequestCount(const CachedResource* res)
{
< prev index next >