| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 namespace WebCore { | 42 namespace WebCore { |
| 43 | 43 |
| 44 class MemoryCache; | 44 class MemoryCache; |
| 45 class CachedMetadata; | 45 class CachedMetadata; |
| 46 class CachedResourceClient; | 46 class CachedResourceClient; |
| 47 class CachedResourceHandleBase; | 47 class CachedResourceHandleBase; |
| 48 class CachedResourceLoader; | 48 class CachedResourceLoader; |
| 49 class InspectorResource; | 49 class InspectorResource; |
| 50 class PurgeableBuffer; | 50 class PurgeableBuffer; |
| 51 class ResourceBuffer; | 51 class ResourceBuffer; |
| 52 class ResourceLoader; | |
| 53 class SecurityOrigin; | 52 class SecurityOrigin; |
| 54 class SharedBuffer; | 53 class SharedBuffer; |
| 54 class SubresourceLoader; |
| 55 | 55 |
| 56 // A resource that is held in the cache. Classes who want to use this object sho
uld derive | 56 // A resource that is held in the cache. Classes who want to use this object sho
uld derive |
| 57 // from CachedResourceClient, to get the function calls in case the requested da
ta has arrived. | 57 // from CachedResourceClient, to get the function calls in case the requested da
ta has arrived. |
| 58 // This class also does the actual communication with the loader to obtain the r
esource from the network. | 58 // This class also does the actual communication with the loader to obtain the r
esource from the network. |
| 59 class CachedResource { | 59 class CachedResource { |
| 60 WTF_MAKE_NONCOPYABLE(CachedResource); WTF_MAKE_FAST_ALLOCATED; | 60 WTF_MAKE_NONCOPYABLE(CachedResource); WTF_MAKE_FAST_ALLOCATED; |
| 61 friend class MemoryCache; | 61 friend class MemoryCache; |
| 62 friend class InspectorResource; | 62 friend class InspectorResource; |
| 63 | 63 |
| 64 public: | 64 public: |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 unsigned encodedSize() const { return m_encodedSize; } | 140 unsigned encodedSize() const { return m_encodedSize; } |
| 141 unsigned decodedSize() const { return m_decodedSize; } | 141 unsigned decodedSize() const { return m_decodedSize; } |
| 142 unsigned overheadSize() const; | 142 unsigned overheadSize() const; |
| 143 | 143 |
| 144 bool isLoaded() const { return !m_loading; } // FIXME. Method name is inaccu
rate. Loading might not have started yet. | 144 bool isLoaded() const { return !m_loading; } // FIXME. Method name is inaccu
rate. Loading might not have started yet. |
| 145 | 145 |
| 146 bool isLoading() const { return m_loading; } | 146 bool isLoading() const { return m_loading; } |
| 147 void setLoading(bool b) { m_loading = b; } | 147 void setLoading(bool b) { m_loading = b; } |
| 148 virtual bool stillNeedsLoad() const { return false; } | 148 virtual bool stillNeedsLoad() const { return false; } |
| 149 | 149 |
| 150 ResourceLoader* loader() { return m_loader.get(); } | 150 SubresourceLoader* loader() { return m_loader.get(); } |
| 151 | 151 |
| 152 virtual bool isImage() const { return false; } | 152 virtual bool isImage() const { return false; } |
| 153 bool ignoreForRequestCount() const | 153 bool ignoreForRequestCount() const |
| 154 { | 154 { |
| 155 return type() == MainResource | 155 return type() == MainResource |
| 156 || type() == LinkPrefetch | 156 || type() == LinkPrefetch |
| 157 || type() == LinkSubresource | 157 || type() == LinkSubresource |
| 158 || type() == RawResource; | 158 || type() == RawResource; |
| 159 } | 159 } |
| 160 | 160 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 CachedResource* m_resource; | 275 CachedResource* m_resource; |
| 276 CachedResourceClient* m_client; | 276 CachedResourceClient* m_client; |
| 277 Timer<CachedResourceCallback> m_callbackTimer; | 277 Timer<CachedResourceCallback> m_callbackTimer; |
| 278 }; | 278 }; |
| 279 HashMap<CachedResourceClient*, OwnPtr<CachedResourceCallback> > m_clientsAwa
itingCallback; | 279 HashMap<CachedResourceClient*, OwnPtr<CachedResourceCallback> > m_clientsAwa
itingCallback; |
| 280 | 280 |
| 281 bool hasClient(CachedResourceClient* client) { return m_clients.contains(cli
ent) || m_clientsAwaitingCallback.contains(client); } | 281 bool hasClient(CachedResourceClient* client) { return m_clients.contains(cli
ent) || m_clientsAwaitingCallback.contains(client); } |
| 282 | 282 |
| 283 ResourceRequest m_resourceRequest; | 283 ResourceRequest m_resourceRequest; |
| 284 String m_accept; | 284 String m_accept; |
| 285 RefPtr<ResourceLoader> m_loader; | 285 RefPtr<SubresourceLoader> m_loader; |
| 286 ResourceLoaderOptions m_options; | 286 ResourceLoaderOptions m_options; |
| 287 ResourceLoadPriority m_loadPriority; | 287 ResourceLoadPriority m_loadPriority; |
| 288 | 288 |
| 289 ResourceResponse m_response; | 289 ResourceResponse m_response; |
| 290 double m_responseTimestamp; | 290 double m_responseTimestamp; |
| 291 | 291 |
| 292 RefPtr<ResourceBuffer> m_data; | 292 RefPtr<ResourceBuffer> m_data; |
| 293 OwnPtr<PurgeableBuffer> m_purgeableData; | 293 OwnPtr<PurgeableBuffer> m_purgeableData; |
| 294 Timer<CachedResource> m_decodedDataDeletionTimer; | 294 Timer<CachedResource> m_decodedDataDeletionTimer; |
| 295 | 295 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 // If this field is non-null, the resource has a proxy for checking whether
it is still up to date (see m_resourceToRevalidate). | 355 // If this field is non-null, the resource has a proxy for checking whether
it is still up to date (see m_resourceToRevalidate). |
| 356 CachedResource* m_proxyResource; | 356 CachedResource* m_proxyResource; |
| 357 | 357 |
| 358 // These handles will need to be updated to point to the m_resourceToRevalid
ate in case we get 304 response. | 358 // These handles will need to be updated to point to the m_resourceToRevalid
ate in case we get 304 response. |
| 359 HashSet<CachedResourceHandleBase*> m_handlesToRevalidate; | 359 HashSet<CachedResourceHandleBase*> m_handlesToRevalidate; |
| 360 }; | 360 }; |
| 361 | 361 |
| 362 } | 362 } |
| 363 | 363 |
| 364 #endif | 364 #endif |
| OLD | NEW |