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) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 4 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
5 | 5 |
6 This library is free software; you can redistribute it and/or | 6 This library is free software; you can redistribute it and/or |
7 modify it under the terms of the GNU Library General Public | 7 modify it under the terms of the GNU Library General Public |
8 License as published by the Free Software Foundation; either | 8 License as published by the Free Software Foundation; either |
9 version 2 of the License, or (at your option) any later version. | 9 version 2 of the License, or (at your option) any later version. |
10 | 10 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 // more resources than the cached resource map, since it can also hold "stal
e" multiple versions of objects that are | 273 // more resources than the cached resource map, since it can also hold "stal
e" multiple versions of objects that are |
274 // waiting to die when the clients referencing them go away. | 274 // waiting to die when the clients referencing them go away. |
275 WillBeHeapVector<MemoryCacheLRUList, 32> m_allResources; | 275 WillBeHeapVector<MemoryCacheLRUList, 32> m_allResources; |
276 | 276 |
277 // Lists just for live resources with decoded data. Access to this list is b
ased off of painting the resource. | 277 // Lists just for live resources with decoded data. Access to this list is b
ased off of painting the resource. |
278 // The lists are ordered by decode priority, with higher indices having high
er priorities. | 278 // The lists are ordered by decode priority, with higher indices having high
er priorities. |
279 MemoryCacheLRUList m_liveDecodedResources[MemoryCacheLiveResourcePriorityHig
h + 1]; | 279 MemoryCacheLRUList m_liveDecodedResources[MemoryCacheLiveResourcePriorityHig
h + 1]; |
280 | 280 |
281 // A URL-based map of all resources that are in the cache (including the fre
shest version of objects that are currently being | 281 // A URL-based map of all resources that are in the cache (including the fre
shest version of objects that are currently being |
282 // referenced by a Web page). | 282 // referenced by a Web page). |
283 typedef WillBeHeapHashMap<String, OwnPtrWillBeMember<MemoryCacheEntry> > Res
ourceMap; | 283 typedef WillBeHeapHashMap<String, OwnPtrWillBeMember<MemoryCacheEntry>> Reso
urceMap; |
284 ResourceMap m_resources; | 284 ResourceMap m_resources; |
285 | 285 |
286 #if ENABLE(OILPAN) | 286 #if ENABLE(OILPAN) |
287 // Unlike m_allResources, m_liveResources is a set of Resource objects which | 287 // Unlike m_allResources, m_liveResources is a set of Resource objects which |
288 // should not be deleted. m_allResources only contains on-cache Resource | 288 // should not be deleted. m_allResources only contains on-cache Resource |
289 // objects. | 289 // objects. |
290 // FIXME: Can we remove manual lifetime management of Resource and this? | 290 // FIXME: Can we remove manual lifetime management of Resource and this? |
291 HeapHashSet<Member<Resource> > m_liveResources; | 291 HeapHashSet<Member<Resource>> m_liveResources; |
292 friend RawPtr<MemoryCache> replaceMemoryCacheForTesting(RawPtr<MemoryCache>)
; | 292 friend RawPtr<MemoryCache> replaceMemoryCacheForTesting(RawPtr<MemoryCache>)
; |
293 #endif | 293 #endif |
294 | 294 |
295 friend class MemoryCacheTest; | 295 friend class MemoryCacheTest; |
296 #ifdef MEMORY_CACHE_STATS | 296 #ifdef MEMORY_CACHE_STATS |
297 Timer<MemoryCache> m_statsTimer; | 297 Timer<MemoryCache> m_statsTimer; |
298 #endif | 298 #endif |
299 }; | 299 }; |
300 | 300 |
301 // Returns the global cache. | 301 // Returns the global cache. |
302 MemoryCache* memoryCache(); | 302 MemoryCache* memoryCache(); |
303 | 303 |
304 // Sets the global cache, used to swap in a test instance. Returns the old | 304 // Sets the global cache, used to swap in a test instance. Returns the old |
305 // MemoryCache object. | 305 // MemoryCache object. |
306 PassOwnPtrWillBeRawPtr<MemoryCache> replaceMemoryCacheForTesting(PassOwnPtrWillB
eRawPtr<MemoryCache>); | 306 PassOwnPtrWillBeRawPtr<MemoryCache> replaceMemoryCacheForTesting(PassOwnPtrWillB
eRawPtr<MemoryCache>); |
307 | 307 |
308 } | 308 } |
309 | 309 |
310 #endif | 310 #endif |
OLD | NEW |