| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 MutexLocker lock(m_mutex); | 171 MutexLocker lock(m_mutex); |
| 172 return m_heapMemoryUsageInBytes; | 172 return m_heapMemoryUsageInBytes; |
| 173 } | 173 } |
| 174 | 174 |
| 175 int ImageDecodingStore::cacheEntries() | 175 int ImageDecodingStore::cacheEntries() |
| 176 { | 176 { |
| 177 MutexLocker lock(m_mutex); | 177 MutexLocker lock(m_mutex); |
| 178 return m_decoderCacheMap.size(); | 178 return m_decoderCacheMap.size(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 int ImageDecodingStore::decoderCacheEntries() | |
| 182 { | |
| 183 MutexLocker lock(m_mutex); | |
| 184 return m_decoderCacheMap.size(); | |
| 185 } | |
| 186 | |
| 187 void ImageDecodingStore::prune() | 181 void ImageDecodingStore::prune() |
| 188 { | 182 { |
| 189 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("blink.image_decoding"), "ImageDecodi
ngStore::prune"); | 183 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("blink.image_decoding"), "ImageDecodi
ngStore::prune"); |
| 190 | 184 |
| 191 Vector<OwnPtr<CacheEntry>> cacheEntriesToDelete; | 185 Vector<OwnPtr<CacheEntry>> cacheEntriesToDelete; |
| 192 { | 186 { |
| 193 MutexLocker lock(m_mutex); | 187 MutexLocker lock(m_mutex); |
| 194 | 188 |
| 195 // Head of the list is the least recently used entry. | 189 // Head of the list is the least recently used entry. |
| 196 const CacheEntry* cacheEntry = m_orderedCacheList.head(); | 190 const CacheEntry* cacheEntry = m_orderedCacheList.head(); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 276 } |
| 283 } | 277 } |
| 284 | 278 |
| 285 void ImageDecodingStore::removeFromCacheListInternal(const Vector<OwnPtr<CacheEn
try>>& deletionList) | 279 void ImageDecodingStore::removeFromCacheListInternal(const Vector<OwnPtr<CacheEn
try>>& deletionList) |
| 286 { | 280 { |
| 287 for (size_t i = 0; i < deletionList.size(); ++i) | 281 for (size_t i = 0; i < deletionList.size(); ++i) |
| 288 m_orderedCacheList.remove(deletionList[i].get()); | 282 m_orderedCacheList.remove(deletionList[i].get()); |
| 289 } | 283 } |
| 290 | 284 |
| 291 } // namespace blink | 285 } // namespace blink |
| OLD | NEW |