ApplicationCacheHost::~ApplicationCacheHost()
{
+ ASSERT(!m_applicationCache || !m_candidateApplicationCacheGroup || m_applicationCache->group() == m_candidateApplicationCacheGroup);
+
if (m_applicationCache)
m_applicationCache->group()->disassociateDocumentLoader(m_documentLoader);
else if (m_candidateApplicationCacheGroup)
}
}
+void ApplicationCacheHost::maybeLoadMainResourceForRedirect(ResourceRequest& request, SubstituteData& substituteData)
+{
+ ASSERT(status() == UNCACHED);
+ maybeLoadMainResource(request, substituteData);
+}
+
bool ApplicationCacheHost::maybeLoadFallbackForMainResponse(const ResourceRequest& request, const ResourceResponse& r)
{
if (r.httpStatusCode() / 100 == 4 || r.httpStatusCode() / 100 == 5) {
{
ApplicationCacheGroup* group = m_candidateApplicationCacheGroup;
if (!group && m_applicationCache) {
- ASSERT(!mainResourceApplicationCache()); // If the main resource were loaded from a cache, it wouldn't fail.
+ if (mainResourceApplicationCache()) {
+ // Even when the main resource is being loaded from an application cache, loading can fail if aborted.
+ return;
+ }
group = m_applicationCache->group();
}
dispatchDOMEvent(id, total, done);
}
+void ApplicationCacheHost::stopLoadingInFrame(Frame* frame)
+{
+ ASSERT(!m_applicationCache || !m_candidateApplicationCacheGroup || m_applicationCache->group() == m_candidateApplicationCacheGroup);
+
+ if (m_candidateApplicationCacheGroup)
+ m_candidateApplicationCacheGroup->stopLoadingInFrame(frame);
+ else if (m_applicationCache)
+ m_applicationCache->group()->stopLoadingInFrame(frame);
+}
+
void ApplicationCacheHost::stopDeferringEvents()
{
RefPtr<DocumentLoader> protect(documentLoader());