| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 Resource* m_resource; | 286 Resource* m_resource; |
| 287 }; | 287 }; |
| 288 | 288 |
| 289 void incrementProtectorCount() { m_protectorCount++; } | 289 void incrementProtectorCount() { m_protectorCount++; } |
| 290 void decrementProtectorCount() { m_protectorCount--; } | 290 void decrementProtectorCount() { m_protectorCount--; } |
| 291 | 291 |
| 292 void setEncodedSize(size_t); | 292 void setEncodedSize(size_t); |
| 293 void setDecodedSize(size_t); | 293 void setDecodedSize(size_t); |
| 294 void didAccessDecodedData(); | 294 void didAccessDecodedData(); |
| 295 | 295 |
| 296 virtual void switchClientsToRevalidatedResource(); | |
| 297 void clearResourceToRevalidate(); | 296 void clearResourceToRevalidate(); |
| 298 void updateResponseAfterRevalidation(const ResourceResponse& validatingRespo
nse); | 297 void updateResponseAfterRevalidation(const ResourceResponse& validatingRespo
nse); |
| 299 | 298 |
| 300 void finishPendingClients(); | 299 void finishPendingClients(); |
| 301 | 300 |
| 302 HashCountedSet<ResourceClient*> m_clients; | 301 HashCountedSet<ResourceClient*> m_clients; |
| 303 HashCountedSet<ResourceClient*> m_clientsAwaitingCallback; | 302 HashCountedSet<ResourceClient*> m_clientsAwaitingCallback; |
| 304 | 303 |
| 305 class ResourceCallback { | 304 class ResourceCallback { |
| 306 public: | 305 public: |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 double m_responseTimestamp; | 341 double m_responseTimestamp; |
| 343 | 342 |
| 344 RefPtr<SharedBuffer> m_data; | 343 RefPtr<SharedBuffer> m_data; |
| 345 Timer<Resource> m_cancelTimer; | 344 Timer<Resource> m_cancelTimer; |
| 346 | 345 |
| 347 private: | 346 private: |
| 348 class CacheHandler; | 347 class CacheHandler; |
| 349 bool addClientToSet(ResourceClient*); | 348 bool addClientToSet(ResourceClient*); |
| 350 void cancelTimerFired(Timer<Resource>*); | 349 void cancelTimerFired(Timer<Resource>*); |
| 351 | 350 |
| 351 void switchClientsToRevalidatedResource(); |
| 352 void revalidationSucceeded(const ResourceResponse&); | 352 void revalidationSucceeded(const ResourceResponse&); |
| 353 void revalidationFailed(); | 353 void revalidationFailed(); |
| 354 | 354 |
| 355 bool unlock(); | 355 bool unlock(); |
| 356 | 356 |
| 357 bool hasRightHandleCountApartFromCache(unsigned targetCount) const; | 357 bool hasRightHandleCountApartFromCache(unsigned targetCount) const; |
| 358 | 358 |
| 359 void setCachedMetadata(unsigned dataTypeID, const char*, size_t, CachedMetad
ataHandler::CacheType); | 359 void setCachedMetadata(unsigned dataTypeID, const char*, size_t, CachedMetad
ataHandler::CacheType); |
| 360 void clearCachedMetadata(CachedMetadataHandler::CacheType); | 360 void clearCachedMetadata(CachedMetadataHandler::CacheType); |
| 361 CachedMetadata* cachedMetadata(unsigned dataTypeID) const; | 361 CachedMetadata* cachedMetadata(unsigned dataTypeID) const; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 const char* ResourceTypeName(Resource::Type); | 420 const char* ResourceTypeName(Resource::Type); |
| 421 #endif | 421 #endif |
| 422 | 422 |
| 423 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 423 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
| 424 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); \ |
| 425 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()); } |
| 426 | 426 |
| 427 } | 427 } |
| 428 | 428 |
| 429 #endif | 429 #endif |
| OLD | NEW |