Commit e3f870c8 authored by ap@apple.com's avatar ap@apple.com

Reviewed by Dan Bernstein.

        https://bugs.webkit.org/show_bug.cgi?id=60787
        Add some assertions to ApplicationCacheGroup

        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::finishedLoadingMainResource): Check that count doesn't underflow.
        (WebCore::ApplicationCacheGroup::failedLoadingMainResource): Ditto.
        (WebCore::ApplicationCacheGroup::stopLoading): Check that we are the handle's client before
        resetting it.
        (WebCore::ApplicationCacheGroup::update): Check that there isn't a stale current handle or
        resource hanging around.
        (WebCore::ApplicationCacheGroup::didFail): Check that the handle is either manifest or current one.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 946fd683
2011-05-13 Alexey Proskuryakov <ap@apple.com>
Reviewed by Dan Bernstein.
https://bugs.webkit.org/show_bug.cgi?id=60787
Add some assertions to ApplicationCacheGroup
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::finishedLoadingMainResource): Check that count doesn't underflow.
(WebCore::ApplicationCacheGroup::failedLoadingMainResource): Ditto.
(WebCore::ApplicationCacheGroup::stopLoading): Check that we are the handle's client before
resetting it.
(WebCore::ApplicationCacheGroup::update): Check that there isn't a stale current handle or
resource hanging around.
(WebCore::ApplicationCacheGroup::didFail): Check that the handle is either manifest or current one.
2011-05-13 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
......@@ -273,6 +273,7 @@ void ApplicationCacheGroup::finishedLoadingMainResource(DocumentLoader* loader)
break;
}
ASSERT(m_downloadingPendingMasterResourceLoadersCount > 0);
m_downloadingPendingMasterResourceLoadersCount--;
checkIfLoadIsComplete();
}
......@@ -317,6 +318,7 @@ void ApplicationCacheGroup::failedLoadingMainResource(DocumentLoader* loader)
break;
}
ASSERT(m_downloadingPendingMasterResourceLoadersCount > 0);
m_downloadingPendingMasterResourceLoadersCount--;
checkIfLoadIsComplete();
}
......@@ -326,7 +328,9 @@ void ApplicationCacheGroup::stopLoading()
if (m_manifestHandle) {
ASSERT(!m_currentHandle);
ASSERT(m_manifestHandle->client() == this);
m_manifestHandle->setClient(0);
m_manifestHandle->cancel();
m_manifestHandle = 0;
}
......@@ -335,7 +339,9 @@ void ApplicationCacheGroup::stopLoading()
ASSERT(!m_manifestHandle);
ASSERT(m_cacheBeingUpdated);
ASSERT(m_currentHandle->client() == this);
m_currentHandle->setClient(0);
m_currentHandle->cancel();
m_currentHandle = 0;
}
......@@ -448,6 +454,8 @@ void ApplicationCacheGroup::update(Frame* frame, ApplicationCacheUpdateOption up
ASSERT(!m_manifestHandle);
ASSERT(!m_manifestResource);
ASSERT(!m_currentHandle);
ASSERT(!m_currentResource);
ASSERT(m_completionType == None);
// FIXME: Handle defer loading
......@@ -630,6 +638,8 @@ void ApplicationCacheGroup::didFail(ResourceHandle* handle, const ResourceError&
return;
}
ASSERT(handle == m_currentHandle);
unsigned type = m_currentResource ? m_currentResource->type() : m_pendingEntries.get(handle->firstRequest().url());
KURL url(handle->firstRequest().url());
if (url.hasFragmentIdentifier())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment