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

Side by Side Diff: Source/core/fetch/Resource.h

Issue 229053004: Allow cache reuse of some requests with Cache-Control headers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> 3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org>
4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBuffe ringPolicy; } 202 DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBuffe ringPolicy; }
203 void setDataBufferingPolicy(DataBufferingPolicy); 203 void setDataBufferingPolicy(DataBufferingPolicy);
204 204
205 bool isPreloaded() const { return m_preloadCount; } 205 bool isPreloaded() const { return m_preloadCount; }
206 void increasePreloadCount() { ++m_preloadCount; } 206 void increasePreloadCount() { ++m_preloadCount; }
207 void decreasePreloadCount() { ASSERT(m_preloadCount); --m_preloadCount; } 207 void decreasePreloadCount() { ASSERT(m_preloadCount); --m_preloadCount; }
208 208
209 void registerHandle(ResourcePtrBase* h); 209 void registerHandle(ResourcePtrBase* h);
210 void unregisterHandle(ResourcePtrBase* h); 210 void unregisterHandle(ResourcePtrBase* h);
211 211
212 bool canReuseRedirectChain() const; 212 bool canReuseRedirectChain();
213 bool mustRevalidateDueToCacheHeaders() const; 213 bool mustRevalidateDueToCacheHeaders();
214 bool canUseCacheValidator() const; 214 bool canUseCacheValidator();
215 bool isCacheValidator() const { return m_resourceToRevalidate; } 215 bool isCacheValidator() const { return m_resourceToRevalidate; }
216 Resource* resourceToRevalidate() const { return m_resourceToRevalidate; } 216 Resource* resourceToRevalidate() const { return m_resourceToRevalidate; }
217 void setResourceToRevalidate(Resource*); 217 void setResourceToRevalidate(Resource*);
218 bool hasCacheControlNoStoreHeader();
218 219
219 bool isPurgeable() const; 220 bool isPurgeable() const;
220 bool wasPurged() const; 221 bool wasPurged() const;
221 bool lock(); 222 bool lock();
222 223
223 virtual void didSendData(unsigned long long /* bytesSent */, unsigned long l ong /* totalBytesToBeSent */) { } 224 virtual void didSendData(unsigned long long /* bytesSent */, unsigned long l ong /* totalBytesToBeSent */) { }
224 virtual void didDownloadData(int) { } 225 virtual void didDownloadData(int) { }
225 226
226 double loadFinishTime() const { return m_loadFinishTime; } 227 double loadFinishTime() const { return m_loadFinishTime; }
227 228
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 bool hasClient(ResourceClient* client) { return m_clients.contains(client) | | m_clientsAwaitingCallback.contains(client); } 298 bool hasClient(ResourceClient* client) { return m_clients.contains(client) | | m_clientsAwaitingCallback.contains(client); }
298 299
299 struct RedirectPair { 300 struct RedirectPair {
300 public: 301 public:
301 explicit RedirectPair(const ResourceRequest& request, const ResourceResp onse& redirectResponse) 302 explicit RedirectPair(const ResourceRequest& request, const ResourceResp onse& redirectResponse)
302 : m_request(request) 303 : m_request(request)
303 , m_redirectResponse(redirectResponse) 304 , m_redirectResponse(redirectResponse)
304 { 305 {
305 } 306 }
306 307
307 const ResourceRequest m_request; 308 ResourceRequest m_request;
308 const ResourceResponse m_redirectResponse; 309 ResourceResponse m_redirectResponse;
309 }; 310 };
310 const Vector<RedirectPair>& redirectChain() const { return m_redirectChain; } 311 const Vector<RedirectPair>& redirectChain() const { return m_redirectChain; }
311 312
312 virtual bool isSafeToUnlock() const { return false; } 313 virtual bool isSafeToUnlock() const { return false; }
313 virtual void destroyDecodedDataIfPossible() { } 314 virtual void destroyDecodedDataIfPossible() { }
314 315
315 ResourceRequest m_resourceRequest; 316 ResourceRequest m_resourceRequest;
316 AtomicString m_accept; 317 AtomicString m_accept;
317 RefPtr<ResourceLoader> m_loader; 318 RefPtr<ResourceLoader> m_loader;
318 ResourceLoaderOptions m_options; 319 ResourceLoaderOptions m_options;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 const char* ResourceTypeName(Resource::Type); 390 const char* ResourceTypeName(Resource::Type);
390 #endif 391 #endif
391 392
392 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 393 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
393 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \ 394 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \
394 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource >& ptr) { return to##typeName##Resource(ptr.get()); } 395 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource >& ptr) { return to##typeName##Resource(ptr.get()); }
395 396
396 } 397 }
397 398
398 #endif 399 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698