diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-06-15 09:06:43 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-06-15 09:31:31 (GMT) |
commit | c411f16870f112c3407c28c22b617f613a82cff4 (patch) | |
tree | 29a1bcd590c8b31af2aab445bfe8a978dc5bf582 /src/3rdparty/webkit/WebCore/loader/CachedResource.h | |
parent | 3d77b56b32a0c53ec0bbfaa07236fedb900ff336 (diff) | |
download | Qt-c411f16870f112c3407c28c22b617f613a82cff4.zip Qt-c411f16870f112c3407c28c22b617f613a82cff4.tar.gz Qt-c411f16870f112c3407c28c22b617f613a82cff4.tar.bz2 |
Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit-4.6-snapshot-15062009 ( 65232bf00dc494ebfd978f998c88f58d18ecce1e )
Diffstat (limited to 'src/3rdparty/webkit/WebCore/loader/CachedResource.h')
-rw-r--r-- | src/3rdparty/webkit/WebCore/loader/CachedResource.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/3rdparty/webkit/WebCore/loader/CachedResource.h b/src/3rdparty/webkit/WebCore/loader/CachedResource.h index 63c250b..16cce26 100644 --- a/src/3rdparty/webkit/WebCore/loader/CachedResource.h +++ b/src/3rdparty/webkit/WebCore/loader/CachedResource.h @@ -82,6 +82,7 @@ public: virtual String encoding() const { return String(); } virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived) = 0; virtual void error() = 0; + virtual void httpStatusCodeError() { error(); } // Images keep loading in spite of HTTP errors (for legacy compat with <img>, etc.). const String &url() const { return m_url; } Type type() const { return m_type; } @@ -126,7 +127,8 @@ public: // Called by the cache if the object has been removed from the cache // while still being referenced. This means the object should delete itself // if the number of clients observing it ever drops to 0. - void setInCache(bool b) { m_inCache = b; } + // The resource can be brought back to cache after successful revalidation. + void setInCache(bool b) { m_inCache = b; if (b) m_isBeingRevalidated = false; } bool inCache() const { return m_inCache; } void setInLiveDecodedResourcesList(bool b) { m_inLiveDecodedResourcesList = b; } @@ -162,7 +164,7 @@ public: void decreasePreloadCount() { ASSERT(m_preloadCount); --m_preloadCount; } void registerHandle(CachedResourceHandleBase* h) { ++m_handleCount; if (m_resourceToRevalidate) m_handlesToRevalidate.add(h); } - void unregisterHandle(CachedResourceHandleBase* h) { --m_handleCount; if (m_resourceToRevalidate) m_handlesToRevalidate.remove(h); if (!m_handleCount) deleteIfPossible(); } + void unregisterHandle(CachedResourceHandleBase* h) { ASSERT(m_handleCount > 0); --m_handleCount; if (m_resourceToRevalidate) m_handlesToRevalidate.remove(h); if (!m_handleCount) deleteIfPossible(); } bool canUseCacheValidator() const; bool mustRevalidate(CachePolicy) const; @@ -172,12 +174,16 @@ public: bool isPurgeable() const; bool wasPurged() const; + // This is used by the archive machinery to get at a purged resource without + // triggering a load. We should make it protected again if we can find a + // better way to handle the archive case. + bool makePurgeable(bool purgeable); + protected: void setEncodedSize(unsigned); void setDecodedSize(unsigned); void didAccessDecodedData(double timeStamp); - bool makePurgeable(bool purgeable); bool isSafeToMakePurgeable() const; HashCountedSet<CachedResourceClient*> m_clients; @@ -187,6 +193,8 @@ protected: Request* m_request; ResourceResponse m_response; + double m_responseTimestamp; + RefPtr<SharedBuffer> m_data; OwnPtr<PurgeableBuffer> m_purgeableData; @@ -200,7 +208,10 @@ private: void setResourceToRevalidate(CachedResource*); void switchClientsToRevalidatedResource(); void clearResourceToRevalidate(); - void setExpirationDate(time_t expirationDate) { m_expirationDate = expirationDate; } + void updateResponseAfterRevalidation(const ResourceResponse& validatingResponse); + + double currentAge() const; + double freshnessLifetime() const; unsigned m_encodedSize; unsigned m_decodedSize; @@ -217,7 +228,6 @@ private: protected: bool m_inCache; bool m_loading; - bool m_expireDateChanged; #ifndef NDEBUG bool m_deleted; unsigned m_lruIndex; @@ -241,8 +251,6 @@ private: bool m_isBeingRevalidated; // These handles will need to be updated to point to the m_resourceToRevalidate in case we get 304 response. HashSet<CachedResourceHandleBase*> m_handlesToRevalidate; - - time_t m_expirationDate; }; } |