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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 { | 109 { |
110 MutexLocker lock(m_mutex); | 110 MutexLocker lock(m_mutex); |
111 DecoderCacheMap::iterator iter = m_decoderCacheMap.find(DecoderCacheEntr
y::makeCacheKey(generator, decoder)); | 111 DecoderCacheMap::iterator iter = m_decoderCacheMap.find(DecoderCacheEntr
y::makeCacheKey(generator, decoder)); |
112 ASSERT_WITH_SECURITY_IMPLICATION(iter != m_decoderCacheMap.end()); | 112 ASSERT_WITH_SECURITY_IMPLICATION(iter != m_decoderCacheMap.end()); |
113 | 113 |
114 CacheEntry* cacheEntry = iter->value.get(); | 114 CacheEntry* cacheEntry = iter->value.get(); |
115 ASSERT(cacheEntry->useCount()); | 115 ASSERT(cacheEntry->useCount()); |
116 cacheEntry->decrementUseCount(); | 116 cacheEntry->decrementUseCount(); |
117 | 117 |
118 // Delete only one decoder cache entry. Ownership of the cache entry | 118 // Delete only one decoder cache entry. Ownership of the cache entry |
119 // is transfered to cacheEntriesToDelete such that object can be deleted | 119 // is transferred to cacheEntriesToDelete such that object can be delete
d |
120 // outside of the lock. | 120 // outside of the lock. |
121 removeFromCacheInternal(cacheEntry, &cacheEntriesToDelete); | 121 removeFromCacheInternal(cacheEntry, &cacheEntriesToDelete); |
122 | 122 |
123 // Remove from LRU list. | 123 // Remove from LRU list. |
124 removeFromCacheListInternal(cacheEntriesToDelete); | 124 removeFromCacheListInternal(cacheEntriesToDelete); |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 void ImageDecodingStore::removeCacheIndexedByGenerator(const ImageFrameGenerator
* generator) | 128 void ImageDecodingStore::removeCacheIndexedByGenerator(const ImageFrameGenerator
* generator) |
129 { | 129 { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 } | 276 } |
277 } | 277 } |
278 | 278 |
279 void ImageDecodingStore::removeFromCacheListInternal(const Vector<OwnPtr<CacheEn
try>>& deletionList) | 279 void ImageDecodingStore::removeFromCacheListInternal(const Vector<OwnPtr<CacheEn
try>>& deletionList) |
280 { | 280 { |
281 for (size_t i = 0; i < deletionList.size(); ++i) | 281 for (size_t i = 0; i < deletionList.size(); ++i) |
282 m_orderedCacheList.remove(deletionList[i].get()); | 282 m_orderedCacheList.remove(deletionList[i].get()); |
283 } | 283 } |
284 | 284 |
285 } // namespace blink | 285 } // namespace blink |
OLD | NEW |