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

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

Issue 2807923002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/graphics (Closed)
Patch Set: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/graphics Created 3 years, 8 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 friend class WTF::DoublyLinkedListNode<CacheEntry>; 105 friend class WTF::DoublyLinkedListNode<CacheEntry>;
106 106
107 public: 107 public:
108 enum CacheType { 108 enum CacheType {
109 TypeDecoder, 109 TypeDecoder,
110 }; 110 };
111 111
112 CacheEntry(const ImageFrameGenerator* generator, int useCount) 112 CacheEntry(const ImageFrameGenerator* generator, int useCount)
113 : m_generator(generator), m_useCount(useCount), m_prev(0), m_next(0) {} 113 : m_generator(generator), m_useCount(useCount), m_prev(0), m_next(0) {}
114 114
115 virtual ~CacheEntry() { ASSERT(!m_useCount); } 115 virtual ~CacheEntry() { DCHECK(!m_useCount); }
116 116
117 const ImageFrameGenerator* generator() const { return m_generator; } 117 const ImageFrameGenerator* generator() const { return m_generator; }
118 int useCount() const { return m_useCount; } 118 int useCount() const { return m_useCount; }
119 void incrementUseCount() { ++m_useCount; } 119 void incrementUseCount() { ++m_useCount; }
120 void decrementUseCount() { 120 void decrementUseCount() {
121 --m_useCount; 121 --m_useCount;
122 ASSERT(m_useCount >= 0); 122 DCHECK_GE(m_useCount, 0);
123 } 123 }
124 124
125 // FIXME: getSafeSize() returns the size in bytes truncated to a 32-bit 125 // FIXME: getSafeSize() returns the size in bytes truncated to a 32-bit
126 // integer. Find a way to get the size in 64-bits. 126 // integer. Find a way to get the size in 64-bits.
127 virtual size_t memoryUsageInBytes() const = 0; 127 virtual size_t memoryUsageInBytes() const = 0;
128 virtual CacheType type() const = 0; 128 virtual CacheType type() const = 0;
129 129
130 protected: 130 protected:
131 const ImageFrameGenerator* m_generator; 131 const ImageFrameGenerator* m_generator;
132 int m_useCount; 132 int m_useCount;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // m_heapLimitInBytes 246 // m_heapLimitInBytes
247 // m_heapMemoryUsageInBytes 247 // m_heapMemoryUsageInBytes
248 // This mutex also protects calls to underlying skBitmap's 248 // This mutex also protects calls to underlying skBitmap's
249 // lockPixels()/unlockPixels() as they are not threadsafe. 249 // lockPixels()/unlockPixels() as they are not threadsafe.
250 Mutex m_mutex; 250 Mutex m_mutex;
251 }; 251 };
252 252
253 } // namespace blink 253 } // namespace blink
254 254
255 #endif 255 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698