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) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 MemoryCacheEntry* previous = current->m_previousInAllResourcesList; | 304 MemoryCacheEntry* previous = current->m_previousInAllResourcesList; |
305 | 305 |
306 // Decoded data may reference other resources. Skip |current| if | 306 // Decoded data may reference other resources. Skip |current| if |
307 // |current| somehow got kicked out of cache during | 307 // |current| somehow got kicked out of cache during |
308 // destroyDecodedData(). | 308 // destroyDecodedData(). |
309 if (!resource || !contains(resource)) { | 309 if (!resource || !contains(resource)) { |
310 current = previous; | 310 current = previous; |
311 continue; | 311 continue; |
312 } | 312 } |
313 | 313 |
| 314 if (strategy == MaximalPrune && resource->isLoaded()) { |
| 315 resource->prune(); |
| 316 current = previous; |
| 317 continue; |
| 318 } |
| 319 |
314 if (!resource->hasClientsOrObservers() && !resource->isPreloaded() &
& resource->isLoaded()) { | 320 if (!resource->hasClientsOrObservers() && !resource->isPreloaded() &
& resource->isLoaded()) { |
315 // Destroy our decoded data. This will remove us from | 321 // Destroy our decoded data. This will remove us from |
316 // m_liveDecodedResources, and possibly move us to a different | 322 // m_liveDecodedResources, and possibly move us to a different |
317 // LRU list in m_allResources. | 323 // LRU list in m_allResources. |
318 resource->prune(); | 324 resource->prune(); |
319 | 325 |
320 if (targetSize && m_deadSize <= targetSize) | 326 if (targetSize && m_deadSize <= targetSize) |
321 return; | 327 return; |
322 } | 328 } |
323 current = previous; | 329 current = previous; |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 printf("(%.1fK, %.1fK, %uA, %dR, %d); ", currentResource->decode
dSize() / 1024.0f, (currentResource->encodedSize() + currentResource->overheadSi
ze()) / 1024.0f, current->m_accessCount, currentResource->hasClientsOrObservers(
), currentResource->isPurgeable()); | 787 printf("(%.1fK, %.1fK, %uA, %dR, %d); ", currentResource->decode
dSize() / 1024.0f, (currentResource->encodedSize() + currentResource->overheadSi
ze()) / 1024.0f, current->m_accessCount, currentResource->hasClientsOrObservers(
), currentResource->isPurgeable()); |
782 | 788 |
783 current = current->m_previousInAllResourcesList; | 789 current = current->m_previousInAllResourcesList; |
784 } | 790 } |
785 } | 791 } |
786 } | 792 } |
787 | 793 |
788 #endif // MEMORY_CACHE_STATS | 794 #endif // MEMORY_CACHE_STATS |
789 | 795 |
790 } // namespace blink | 796 } // namespace blink |
OLD | NEW |