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 | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 rights reserved. | 6 rights reserved. |
7 | 7 |
8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // resource clients that simply observe the resource. | 154 // resource clients that simply observe the resource. |
155 void addClient(ResourceClient*, PreloadReferencePolicy = MarkAsReferenced); | 155 void addClient(ResourceClient*, PreloadReferencePolicy = MarkAsReferenced); |
156 void removeClient(ResourceClient*); | 156 void removeClient(ResourceClient*); |
157 | 157 |
158 enum PreloadResult { | 158 enum PreloadResult { |
159 PreloadNotReferenced, | 159 PreloadNotReferenced, |
160 PreloadReferenced, | 160 PreloadReferenced, |
161 PreloadReferencedWhileLoading, | 161 PreloadReferencedWhileLoading, |
162 PreloadReferencedWhileComplete | 162 PreloadReferencedWhileComplete |
163 }; | 163 }; |
164 PreloadResult getPreloadResult() const { | 164 PreloadResult getPreloadResult() const { return m_preloadResult; } |
165 return static_cast<PreloadResult>(m_preloadResult); | |
166 } | |
167 | 165 |
168 Status getStatus() const { return static_cast<Status>(m_status); } | 166 Status getStatus() const { return m_status; } |
169 void setStatus(Status status) { m_status = status; } | 167 void setStatus(Status status) { m_status = status; } |
170 | 168 |
171 size_t size() const { return encodedSize() + decodedSize() + overheadSize(); } | 169 size_t size() const { return encodedSize() + decodedSize() + overheadSize(); } |
172 | 170 |
173 // Returns the size of content (response body) before decoding. Adding a new | 171 // Returns the size of content (response body) before decoding. Adding a new |
174 // usage of this function is not recommended (See the TODO below). | 172 // usage of this function is not recommended (See the TODO below). |
175 // | 173 // |
176 // TODO(hiroshige): Now encodedSize/decodedSize states are inconsistent and | 174 // TODO(hiroshige): Now encodedSize/decodedSize states are inconsistent and |
177 // need to be refactored (crbug/643135). | 175 // need to be refactored (crbug/643135). |
178 size_t encodedSize() const { return m_encodedSize; } | 176 size_t encodedSize() const { return m_encodedSize; } |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 // initial |m_resourceRequest| is given, to reduce MemoryCache manipulation | 425 // initial |m_resourceRequest| is given, to reduce MemoryCache manipulation |
428 // and thus potential bugs. crbug.com/594644 | 426 // and thus potential bugs. crbug.com/594644 |
429 const size_t m_overheadSize; | 427 const size_t m_overheadSize; |
430 | 428 |
431 unsigned m_preloadCount; | 429 unsigned m_preloadCount; |
432 | 430 |
433 double m_preloadDiscoveryTime; | 431 double m_preloadDiscoveryTime; |
434 | 432 |
435 String m_cacheIdentifier; | 433 String m_cacheIdentifier; |
436 | 434 |
437 unsigned m_preloadResult : 2; // PreloadResult | 435 PreloadResult m_preloadResult; |
438 unsigned m_type : 4; // Type | 436 Type m_type; |
439 unsigned m_status : 3; // Status | 437 Status m_status; |
440 | 438 |
441 bool m_needsSynchronousCacheHit; | 439 bool m_needsSynchronousCacheHit; |
442 bool m_linkPreload; | 440 bool m_linkPreload; |
443 bool m_isRevalidating; | 441 bool m_isRevalidating; |
444 bool m_isAlive; | 442 bool m_isAlive; |
445 bool m_isAddRemoveClientProhibited; | 443 bool m_isAddRemoveClientProhibited; |
446 | 444 |
447 ResourceIntegrityDisposition m_integrityDisposition; | 445 ResourceIntegrityDisposition m_integrityDisposition; |
448 IntegrityMetadataSet m_integrityMetadata; | 446 IntegrityMetadataSet m_integrityMetadata; |
449 | 447 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 }; | 481 }; |
484 | 482 |
485 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 483 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
486 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ | 484 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ |
487 resource->getType() == Resource::typeName, \ | 485 resource->getType() == Resource::typeName, \ |
488 resource.getType() == Resource::typeName); | 486 resource.getType() == Resource::typeName); |
489 | 487 |
490 } // namespace blink | 488 } // namespace blink |
491 | 489 |
492 #endif | 490 #endif |
OLD | NEW |