From 635860845790a19bf50bbc51ba8fb66a96dde068 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Thu, 5 Mar 2009 14:34:32 -0800 Subject: auto import from //depot/cupcake/@136594 --- WebCore/loader/DocumentLoader.h | 43 ++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'WebCore/loader/DocumentLoader.h') diff --git a/WebCore/loader/DocumentLoader.h b/WebCore/loader/DocumentLoader.h index aef4f49..85cceef 100644 --- a/WebCore/loader/DocumentLoader.h +++ b/WebCore/loader/DocumentLoader.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,25 +29,18 @@ #ifndef DocumentLoader_h #define DocumentLoader_h -#include "IconDatabase.h" #include "NavigationAction.h" -#include -#include "PlatformString.h" #include "ResourceError.h" #include "ResourceRequest.h" #include "ResourceResponse.h" #include "SubstituteData.h" -#include -#include -#include +#include "Timer.h" namespace WebCore { -#if ENABLE(OFFLINE_WEB_APPLICATIONS) class ApplicationCache; class ApplicationCacheGroup; class ApplicationCacheResource; -#endif #if ENABLE(ARCHIVE) // ANDROID extension: disabled to reduce code size class Archive; class ArchiveResource; @@ -56,13 +49,10 @@ namespace WebCore { class CachedPage; class Frame; class FrameLoader; - class HistoryItem; - class KURL; class MainResourceLoader; class ResourceLoader; class SchedulePair; class SharedBuffer; - class SubstituteData; class SubstituteResource; typedef HashSet > ResourceLoaderSet; @@ -167,7 +157,12 @@ namespace WebCore { void stopRecordingResponses(); const String& title() const { return m_pageTitle; } + KURL urlForHistory() const; + bool urlForHistoryReflectsFailure() const; + bool urlForHistoryReflectsServerRedirect() const { return urlForHistory() != url(); } + bool urlForHistoryReflectsClientRedirect() const { return m_urlForHistoryReflectsClientRedirect; } + void setURLForHistoryReflectsClientRedirect(bool b) { m_urlForHistoryReflectsClientRedirect = b; } void loadFromCachedPage(PassRefPtr); void setLoadingFromCachedPage(bool loading) { m_loadingFromCachedPage = loading; } @@ -198,16 +193,22 @@ namespace WebCore { void setDeferMainResourceDataLoad(bool defer) { m_deferMainResourceDataLoad = defer; } bool deferMainResourceDataLoad() const { return m_deferMainResourceDataLoad; } + void didTellClientAboutLoad(const String& url) { m_resourcesClientKnowsAbout.add(url); } + bool haveToldClientAboutLoad(const String& url) { return m_resourcesClientKnowsAbout.contains(url); } + void recordMemoryCacheLoadForFutureClientNotification(const String& url); + void takeMemoryCacheLoadsForClientNotification(Vector& loads); + #if ENABLE(OFFLINE_WEB_APPLICATIONS) bool scheduleApplicationCacheLoad(ResourceLoader*, const ResourceRequest&, const KURL& originalURL); + bool scheduleLoadFallbackResourceFromApplicationCache(ResourceLoader*, const ResourceRequest&, ApplicationCache* = 0); bool shouldLoadResourceFromApplicationCache(const ResourceRequest&, ApplicationCacheResource*&); + bool getApplicationCacheFallbackResource(const ResourceRequest&, ApplicationCacheResource*&, ApplicationCache* = 0); void setCandidateApplicationCacheGroup(ApplicationCacheGroup* group); ApplicationCacheGroup* candidateApplicationCacheGroup() const { return m_candidateApplicationCacheGroup; } void setApplicationCache(PassRefPtr applicationCache); ApplicationCache* applicationCache() const { return m_applicationCache.get(); } - ApplicationCache* topLevelApplicationCache() const; ApplicationCache* mainResourceApplicationCache() const; #endif @@ -292,7 +293,12 @@ namespace WebCore { OwnPtr m_archiveResourceCollection; RefPtr m_parsedArchiveData; #endif + + HashSet m_resourcesClientKnowsAbout; + Vector m_resourcesLoadedFromMemoryCacheForClientNotification; + bool m_urlForHistoryReflectsClientRedirect; + #if ENABLE(OFFLINE_WEB_APPLICATIONS) // The application cache that the document loader is associated with (if any). RefPtr m_applicationCache; @@ -306,6 +312,17 @@ namespace WebCore { #endif }; + inline void DocumentLoader::recordMemoryCacheLoadForFutureClientNotification(const String& url) + { + m_resourcesLoadedFromMemoryCacheForClientNotification.append(url); + } + + inline void DocumentLoader::takeMemoryCacheLoadsForClientNotification(Vector& loadsSet) + { + loadsSet.swap(m_resourcesLoadedFromMemoryCacheForClientNotification); + m_resourcesLoadedFromMemoryCacheForClientNotification.clear(); + } + } #endif // DocumentLoader_h -- cgit v1.1