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

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

Issue 2640163004: Replace ENABLE(ASSERT) with DCHECK_IS_ON(). (Closed)
Patch Set: Created 3 years, 11 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 25 matching lines...) Expand all
36 36
37 static const size_t defaultMaxTotalSizeOfHeapEntries = 32 * 1024 * 1024; 37 static const size_t defaultMaxTotalSizeOfHeapEntries = 32 * 1024 * 1024;
38 38
39 } // namespace 39 } // namespace
40 40
41 ImageDecodingStore::ImageDecodingStore() 41 ImageDecodingStore::ImageDecodingStore()
42 : m_heapLimitInBytes(defaultMaxTotalSizeOfHeapEntries), 42 : m_heapLimitInBytes(defaultMaxTotalSizeOfHeapEntries),
43 m_heapMemoryUsageInBytes(0) {} 43 m_heapMemoryUsageInBytes(0) {}
44 44
45 ImageDecodingStore::~ImageDecodingStore() { 45 ImageDecodingStore::~ImageDecodingStore() {
46 #if ENABLE(ASSERT) 46 #if DCHECK_IS_ON()
47 setCacheLimitInBytes(0); 47 setCacheLimitInBytes(0);
48 ASSERT(!m_decoderCacheMap.size()); 48 ASSERT(!m_decoderCacheMap.size());
49 ASSERT(!m_orderedCacheList.size()); 49 ASSERT(!m_orderedCacheList.size());
50 ASSERT(!m_decoderCacheKeyMap.size()); 50 ASSERT(!m_decoderCacheKeyMap.size());
51 #endif 51 #endif
52 } 52 }
53 53
54 ImageDecodingStore& ImageDecodingStore::instance() { 54 ImageDecodingStore& ImageDecodingStore::instance() {
55 DEFINE_THREAD_SAFE_STATIC_LOCAL(ImageDecodingStore, store, 55 DEFINE_THREAD_SAFE_STATIC_LOCAL(ImageDecodingStore, store,
56 ImageDecodingStore::create().release()); 56 ImageDecodingStore::create().release());
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 296 }
297 } 297 }
298 298
299 void ImageDecodingStore::removeFromCacheListInternal( 299 void ImageDecodingStore::removeFromCacheListInternal(
300 const Vector<std::unique_ptr<CacheEntry>>& deletionList) { 300 const Vector<std::unique_ptr<CacheEntry>>& deletionList) {
301 for (size_t i = 0; i < deletionList.size(); ++i) 301 for (size_t i = 0; i < deletionList.size(); ++i)
302 m_orderedCacheList.remove(deletionList[i].get()); 302 m_orderedCacheList.remove(deletionList[i].get());
303 } 303 }
304 304
305 } // namespace blink 305 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698