Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp

Issue 1981823002: Remove OwnPtr::release() calls in platform/ (part 1). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 void ImageDecodingStore::insertDecoder(const ImageFrameGenerator* generator, Pas sOwnPtr<ImageDecoder> decoder) 93 void ImageDecodingStore::insertDecoder(const ImageFrameGenerator* generator, Pas sOwnPtr<ImageDecoder> decoder)
94 { 94 {
95 // Prune old cache entries to give space for the new one. 95 // Prune old cache entries to give space for the new one.
96 prune(); 96 prune();
97 97
98 OwnPtr<DecoderCacheEntry> newCacheEntry = DecoderCacheEntry::create(generato r, std::move(decoder)); 98 OwnPtr<DecoderCacheEntry> newCacheEntry = DecoderCacheEntry::create(generato r, std::move(decoder));
99 99
100 MutexLocker lock(m_mutex); 100 MutexLocker lock(m_mutex);
101 ASSERT(!m_decoderCacheMap.contains(newCacheEntry->cacheKey())); 101 ASSERT(!m_decoderCacheMap.contains(newCacheEntry->cacheKey()));
102 insertCacheInternal(newCacheEntry.release(), &m_decoderCacheMap, &m_decoderC acheKeyMap); 102 insertCacheInternal(std::move(newCacheEntry), &m_decoderCacheMap, &m_decoder CacheKeyMap);
103 } 103 }
104 104
105 void ImageDecodingStore::removeDecoder(const ImageFrameGenerator* generator, con st ImageDecoder* decoder) 105 void ImageDecodingStore::removeDecoder(const ImageFrameGenerator* generator, con st ImageDecoder* decoder)
106 { 106 {
107 Vector<OwnPtr<CacheEntry>> cacheEntriesToDelete; 107 Vector<OwnPtr<CacheEntry>> cacheEntriesToDelete;
108 { 108 {
109 MutexLocker lock(m_mutex); 109 MutexLocker lock(m_mutex);
110 DecoderCacheMap::iterator iter = m_decoderCacheMap.find(DecoderCacheEntr y::makeCacheKey(generator, decoder)); 110 DecoderCacheMap::iterator iter = m_decoderCacheMap.find(DecoderCacheEntr y::makeCacheKey(generator, decoder));
111 ASSERT_WITH_SECURITY_IMPLICATION(iter != m_decoderCacheMap.end()); 111 ASSERT_WITH_SECURITY_IMPLICATION(iter != m_decoderCacheMap.end());
112 112
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 275 }
276 } 276 }
277 277
278 void ImageDecodingStore::removeFromCacheListInternal(const Vector<OwnPtr<CacheEn try>>& deletionList) 278 void ImageDecodingStore::removeFromCacheListInternal(const Vector<OwnPtr<CacheEn try>>& deletionList)
279 { 279 {
280 for (size_t i = 0; i < deletionList.size(); ++i) 280 for (size_t i = 0; i < deletionList.size(); ++i)
281 m_orderedCacheList.remove(deletionList[i].get()); 281 m_orderedCacheList.remove(deletionList[i].get());
282 } 282 }
283 283
284 } // namespace blink 284 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698