Commit 6d4ec89b authored by andersca@apple.com's avatar andersca@apple.com

2008-04-15 Anders Carlsson <andersca@apple.com>

        Reviewed by Adam.

        Rename "archive" to "substitute" in a couple of places.
        
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::DocumentLoader):
        (WebCore::DocumentLoader::clearArchiveResources):
        (WebCore::DocumentLoader::deliverSubstituteResourcesAfterDelay):
        (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
        (WebCore::DocumentLoader::isSubstituteLoadPending):
        (WebCore::DocumentLoader::cancelPendingSubstituteLoad):
        (WebCore::DocumentLoader::scheduleArchiveLoad):
        (WebCore::DocumentLoader::setDefersLoading):
        * loader/DocumentLoader.h:
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::load):
        (WebCore::ResourceLoader::didCancel):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 31d4115a
2008-04-15 Anders Carlsson <andersca@apple.com>
Reviewed by Adam.
Rename "archive" to "substitute" in a couple of places.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader):
(WebCore::DocumentLoader::clearArchiveResources):
(WebCore::DocumentLoader::deliverSubstituteResourcesAfterDelay):
(WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
(WebCore::DocumentLoader::isSubstituteLoadPending):
(WebCore::DocumentLoader::cancelPendingSubstituteLoad):
(WebCore::DocumentLoader::scheduleArchiveLoad):
(WebCore::DocumentLoader::setDefersLoading):
* loader/DocumentLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::load):
(WebCore::ResourceLoader::didCancel):
2008-04-15 Anders Carlsson <andersca@apple.com>
Reviewed by Adam.
......@@ -143,7 +143,7 @@ DocumentLoader::DocumentLoader(const ResourceRequest& req, const SubstituteData&
, m_isClientRedirect(false)
, m_loadingFromCachedPage(false)
, m_stopRecordingResponses(false)
, m_archiveResourceDeliveryTimer(this, &DocumentLoader::archiveResourceDeliveryTimerFired)
, m_substituteResourceDeliveryTimer(this, &DocumentLoader::substituteResourceDeliveryTimerFired)
{
}
......@@ -486,7 +486,7 @@ PassRefPtr<Archive> DocumentLoader::popArchiveForSubframe(const String& frameNam
void DocumentLoader::clearArchiveResources()
{
m_archiveResourceCollection.clear();
m_archiveResourceDeliveryTimer.stop();
m_substituteResourceDeliveryTimer.stop();
}
void DocumentLoader::setParsedArchiveData(PassRefPtr<SharedBuffer> data)
......@@ -541,32 +541,32 @@ void DocumentLoader::getSubresources(Vector<PassRefPtr<ArchiveResource> >& subre
return;
}
void DocumentLoader::deliverArchivedResourcesAfterDelay()
void DocumentLoader::deliverSubstituteResourcesAfterDelay()
{
if (m_pendingArchiveResources.isEmpty())
if (m_pendingSubstituteResources.isEmpty())
return;
ASSERT(m_frame && m_frame->page());
if (m_frame->page()->defersLoading())
return;
if (!m_archiveResourceDeliveryTimer.isActive())
m_archiveResourceDeliveryTimer.startOneShot(0);
if (!m_substituteResourceDeliveryTimer.isActive())
m_substituteResourceDeliveryTimer.startOneShot(0);
}
void DocumentLoader::archiveResourceDeliveryTimerFired(Timer<DocumentLoader>*)
void DocumentLoader::substituteResourceDeliveryTimerFired(Timer<DocumentLoader>*)
{
if (m_pendingArchiveResources.isEmpty())
if (m_pendingSubstituteResources.isEmpty())
return;
ASSERT(m_frame && m_frame->page());
if (m_frame->page()->defersLoading())
return;
ArchiveResourceMap copy;
copy.swap(m_pendingArchiveResources);
SubstituteResourceMap copy;
copy.swap(m_pendingSubstituteResources);
ArchiveResourceMap::const_iterator end = copy.end();
for (ArchiveResourceMap::const_iterator it = copy.begin(); it != end; ++it) {
SubstituteResourceMap::const_iterator end = copy.end();
for (SubstituteResourceMap::const_iterator it = copy.begin(); it != end; ++it) {
RefPtr<ResourceLoader> loader = it->first;
ArchiveResource* resource = it->second.get();
SubstituteResource* resource = it->second.get();
SharedBuffer* data = resource->data();
......@@ -577,19 +577,19 @@ void DocumentLoader::archiveResourceDeliveryTimerFired(Timer<DocumentLoader>*)
}
#ifndef NDEBUG
bool DocumentLoader::isArchiveLoadPending(ResourceLoader* loader) const
bool DocumentLoader::isSubstituteLoadPending(ResourceLoader* loader) const
{
return m_pendingArchiveResources.contains(loader);
return m_pendingSubstituteResources.contains(loader);
}
#endif
void DocumentLoader::cancelPendingArchiveLoad(ResourceLoader* loader)
void DocumentLoader::cancelPendingSubstituteLoad(ResourceLoader* loader)
{
if (m_pendingArchiveResources.isEmpty())
if (m_pendingSubstituteResources.isEmpty())
return;
m_pendingArchiveResources.remove(loader);
if (m_pendingArchiveResources.isEmpty())
m_archiveResourceDeliveryTimer.stop();
m_pendingSubstituteResources.remove(loader);
if (m_pendingSubstituteResources.isEmpty())
m_substituteResourceDeliveryTimer.stop();
}
bool DocumentLoader::scheduleArchiveLoad(ResourceLoader* loader, const ResourceRequest& request, const KURL& originalURL)
......@@ -601,8 +601,8 @@ bool DocumentLoader::scheduleArchiveLoad(ResourceLoader* loader, const ResourceR
if (!resource)
return false;
m_pendingArchiveResources.set(loader, resource);
deliverArchivedResourcesAfterDelay();
m_pendingSubstituteResources.set(loader, resource);
deliverSubstituteResourcesAfterDelay();
return true;
}
......@@ -684,7 +684,7 @@ void DocumentLoader::setDefersLoading(bool defers)
setAllDefersLoading(m_subresourceLoaders, defers);
setAllDefersLoading(m_plugInStreamLoaders, defers);
if (!defers)
deliverArchivedResourcesAfterDelay();
deliverSubstituteResourcesAfterDelay();
}
void DocumentLoader::stopLoadingPlugIns()
......
......@@ -56,6 +56,7 @@ namespace WebCore {
class SchedulePair;
class SharedBuffer;
class SubstituteData;
class SubstituteResource;
typedef HashSet<RefPtr<ResourceLoader> > ResourceLoaderSet;
typedef Vector<ResourceResponse> ResponseVector;
......@@ -139,9 +140,9 @@ namespace WebCore {
bool scheduleArchiveLoad(ResourceLoader*, const ResourceRequest&, const KURL&);
#ifndef NDEBUG
bool isArchiveLoadPending(ResourceLoader*) const;
bool isSubstituteLoadPending(ResourceLoader*) const;
#endif
void cancelPendingArchiveLoad(ResourceLoader*);
void cancelPendingSubstituteLoad(ResourceLoader*);
void addResponse(const ResourceResponse&);
const ResponseVector& responses() const { return m_responses; }
......@@ -194,8 +195,8 @@ namespace WebCore {
void commitLoad(const char*, int);
bool doesProgressiveLoad(const String& MIMEType) const;
void deliverArchivedResourcesAfterDelay();
void archiveResourceDeliveryTimerFired(Timer<DocumentLoader>*);
void deliverSubstituteResourcesAfterDelay();
void substituteResourceDeliveryTimerFired(Timer<DocumentLoader>*);
Frame* m_frame;
......@@ -255,9 +256,9 @@ namespace WebCore {
ResponseVector m_responses;
bool m_stopRecordingResponses;
typedef HashMap<RefPtr<ResourceLoader>, RefPtr<ArchiveResource> > ArchiveResourceMap;
ArchiveResourceMap m_pendingArchiveResources;
Timer<DocumentLoader> m_archiveResourceDeliveryTimer;
typedef HashMap<RefPtr<ResourceLoader>, RefPtr<SubstituteResource> > SubstituteResourceMap;
SubstituteResourceMap m_pendingSubstituteResources;
Timer<DocumentLoader> m_substituteResourceDeliveryTimer;
OwnPtr<ArchiveResourceCollection> m_archiveResourceCollection;
RefPtr<SharedBuffer> m_parsedArchiveData;
......
......@@ -107,7 +107,7 @@ bool ResourceLoader::load(const ResourceRequest& r)
{
ASSERT(!m_handle);
ASSERT(m_deferredRequest.isNull());
ASSERT(!m_documentLoader->isArchiveLoadPending(this));
ASSERT(!m_documentLoader->isSubstituteLoadPending(this));
ResourceRequest clientRequest(r);
willSendRequest(clientRequest, ResourceResponse());
......@@ -314,7 +314,7 @@ void ResourceLoader::didCancel(const ResourceError& error)
if (m_handle)
m_handle->clearAuthentication();
m_documentLoader->cancelPendingArchiveLoad(this);
m_documentLoader->cancelPendingSubstituteLoad(this);
if (m_handle) {
m_handle->cancel();
m_handle = 0;
......
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