OLD | NEW |
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 bool canUseCacheValidator(); | 235 bool canUseCacheValidator(); |
236 bool isCacheValidator() const { return m_resourceToRevalidate; } | 236 bool isCacheValidator() const { return m_resourceToRevalidate; } |
237 Resource* resourceToRevalidate() const { return m_resourceToRevalidate; } | 237 Resource* resourceToRevalidate() const { return m_resourceToRevalidate; } |
238 void setResourceToRevalidate(Resource*); | 238 void setResourceToRevalidate(Resource*); |
239 bool hasCacheControlNoStoreHeader(); | 239 bool hasCacheControlNoStoreHeader(); |
240 | 240 |
241 bool isPurgeable() const; | 241 bool isPurgeable() const; |
242 bool wasPurged() const; | 242 bool wasPurged() const; |
243 bool lock(); | 243 bool lock(); |
244 | 244 |
| 245 void setCacheIdentifier(const String& cacheIdentifier) { m_cacheIdentifier =
cacheIdentifier; } |
| 246 String cacheIdentifier() const { return m_cacheIdentifier; }; |
| 247 |
245 virtual void didSendData(unsigned long long /* bytesSent */, unsigned long l
ong /* totalBytesToBeSent */) { } | 248 virtual void didSendData(unsigned long long /* bytesSent */, unsigned long l
ong /* totalBytesToBeSent */) { } |
246 virtual void didDownloadData(int) { } | 249 virtual void didDownloadData(int) { } |
247 | 250 |
248 double loadFinishTime() const { return m_loadFinishTime; } | 251 double loadFinishTime() const { return m_loadFinishTime; } |
249 | 252 |
250 virtual bool canReuse(const ResourceRequest&) const { return true; } | 253 virtual bool canReuse(const ResourceRequest&) const { return true; } |
251 | 254 |
252 // Used by the MemoryCache to reduce the memory consumption of the entry. | 255 // Used by the MemoryCache to reduce the memory consumption of the entry. |
253 void prune(); | 256 void prune(); |
254 | 257 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 double m_loadFinishTime; | 370 double m_loadFinishTime; |
368 | 371 |
369 unsigned long m_identifier; | 372 unsigned long m_identifier; |
370 | 373 |
371 size_t m_encodedSize; | 374 size_t m_encodedSize; |
372 size_t m_decodedSize; | 375 size_t m_decodedSize; |
373 unsigned m_handleCount; | 376 unsigned m_handleCount; |
374 unsigned m_preloadCount; | 377 unsigned m_preloadCount; |
375 unsigned m_protectorCount; | 378 unsigned m_protectorCount; |
376 | 379 |
| 380 String m_cacheIdentifier; |
| 381 |
377 unsigned m_preloadResult : 2; // PreloadResult | 382 unsigned m_preloadResult : 2; // PreloadResult |
378 unsigned m_requestedFromNetworkingLayer : 1; | 383 unsigned m_requestedFromNetworkingLayer : 1; |
379 | 384 |
380 unsigned m_loading : 1; | 385 unsigned m_loading : 1; |
381 | 386 |
382 unsigned m_switchingClientsToRevalidatedResource : 1; | 387 unsigned m_switchingClientsToRevalidatedResource : 1; |
383 | 388 |
384 unsigned m_type : 4; // Type | 389 unsigned m_type : 4; // Type |
385 unsigned m_status : 3; // Status | 390 unsigned m_status : 3; // Status |
386 | 391 |
(...skipping 28 matching lines...) Expand all Loading... |
415 const char* ResourceTypeName(Resource::Type); | 420 const char* ResourceTypeName(Resource::Type); |
416 #endif | 421 #endif |
417 | 422 |
418 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 423 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
419 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() =
= Resource::typeName, resource.type() == Resource::typeName); \ | 424 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() =
= Resource::typeName, resource.type() == Resource::typeName); \ |
420 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource
>& ptr) { return to##typeName##Resource(ptr.get()); } | 425 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource
>& ptr) { return to##typeName##Resource(ptr.get()); } |
421 | 426 |
422 } | 427 } |
423 | 428 |
424 #endif | 429 #endif |
OLD | NEW |