Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: Source/core/fetch/Resource.h

Issue 1237983003: Revalidate using the same Resource, attempt #2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/fetch/Resource.h
diff --git a/Source/core/fetch/Resource.h b/Source/core/fetch/Resource.h
index 8344ca9539bf61dbe8cc340d97ec42f5548f86c0..5e742ff4f84f1508b2c7924127f11a423346f1b1 100644
--- a/Source/core/fetch/Resource.h
+++ b/Source/core/fetch/Resource.h
@@ -121,6 +121,8 @@ public:
const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
const ResourceRequest& lastResourceRequest() const;
+ void setRevalidatingRequest(const ResourceRequest& request) { m_revalidatingRequest = request; }
+
const KURL& url() const { return m_resourceRequest.url();}
Type type() const { return static_cast<Type>(m_type); }
const ResourceLoaderOptions& options() const { return m_options; }
@@ -230,9 +232,7 @@ public:
bool canReuseRedirectChain();
bool mustRevalidateDueToCacheHeaders();
bool canUseCacheValidator();
- bool isCacheValidator() const { return m_resourceToRevalidate; }
- Resource* resourceToRevalidate() const { return m_resourceToRevalidate; }
- void setResourceToRevalidate(Resource*);
+ bool isCacheValidator() const { return !m_revalidatingRequest.isNull(); }
bool hasCacheControlNoStoreHeader();
double currentAge() const;
@@ -268,6 +268,8 @@ protected:
virtual void checkNotify();
virtual void finishOnePart();
+ virtual void destroyDecodedDataForFailedRevalidation() { }
+
// Normal resource pointers will silently switch what Resource* they reference when we
// successfully revalidated the resource. We need a way to guarantee that the Resource
// that received the 304 response survives long enough to switch everything over to the
@@ -298,9 +300,6 @@ protected:
void setDecodedSize(size_t);
void didAccessDecodedData();
- void clearResourceToRevalidate();
- void updateResponseAfterRevalidation(const ResourceResponse& validatingResponse);
-
void finishPendingClients();
HashCountedSet<ResourceClient*> m_clients;
@@ -338,6 +337,7 @@ protected:
virtual void destroyDecodedDataIfPossible() { }
ResourceRequest m_resourceRequest;
+ ResourceRequest m_revalidatingRequest;
AtomicString m_accept;
PersistentWillBeMember<ResourceLoader> m_loader;
ResourceLoaderOptions m_options;
@@ -402,18 +402,6 @@ private:
bool m_deleted;
#endif
- // If this field is non-null we are using the resource as a proxy for checking whether an existing resource is still up to date
- // using HTTP If-Modified-Since/If-None-Match headers. If the response is 304 all clients of this resource are moved
- // to to be clients of m_resourceToRevalidate and the resource is deleted. If not, the field is zeroed and this
- // resources becomes normal resource load.
- RawPtrWillBeMember<Resource> m_resourceToRevalidate;
-
- // If this field is non-null, the resource has a proxy for checking whether it is still up to date (see m_resourceToRevalidate).
- RawPtrWillBeMember<Resource> m_proxyResource;
-
- // These handles will need to be updated to point to the m_resourceToRevalidate in case we get 304 response.
- HashSet<ResourcePtrBase*> m_handlesToRevalidate;
-
// Ordered list of all redirects followed while fetching this resource.
Vector<RedirectPair> m_redirectChain;
};

Powered by Google App Engine
This is Rietveld 408576698