mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1842658
- Part 1: Use a refcounting macro for imgCacheEntry, r=tnikkel
It appears that when this was originally added in bug 430061, the inline refcounting macros didn't exist yet. Differential Revision: https://phabricator.services.mozilla.com/D183203
This commit is contained in:
parent
10ecbeeb01
commit
ca0d37e8d5
@ -42,30 +42,10 @@ class Document;
|
||||
|
||||
class imgCacheEntry {
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(imgCacheEntry)
|
||||
|
||||
imgCacheEntry(imgLoader* loader, imgRequest* request,
|
||||
bool aForcePrincipalCheck);
|
||||
~imgCacheEntry();
|
||||
|
||||
nsrefcnt AddRef() {
|
||||
MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");
|
||||
NS_ASSERT_OWNINGTHREAD(imgCacheEntry);
|
||||
++mRefCnt;
|
||||
NS_LOG_ADDREF(this, mRefCnt, "imgCacheEntry", sizeof(*this));
|
||||
return mRefCnt;
|
||||
}
|
||||
|
||||
nsrefcnt Release() {
|
||||
MOZ_ASSERT(0 != mRefCnt, "dup release");
|
||||
NS_ASSERT_OWNINGTHREAD(imgCacheEntry);
|
||||
--mRefCnt;
|
||||
NS_LOG_RELEASE(this, mRefCnt, "imgCacheEntry");
|
||||
if (mRefCnt == 0) {
|
||||
mRefCnt = 1; /* stabilize */
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return mRefCnt;
|
||||
}
|
||||
|
||||
uint32_t GetDataSize() const { return mDataSize; }
|
||||
void SetDataSize(uint32_t aDataSize) {
|
||||
@ -127,11 +107,9 @@ class imgCacheEntry {
|
||||
|
||||
// Private, unimplemented copy constructor.
|
||||
imgCacheEntry(const imgCacheEntry&);
|
||||
~imgCacheEntry();
|
||||
|
||||
private: // data
|
||||
nsAutoRefCnt mRefCnt;
|
||||
NS_DECL_OWNINGTHREAD
|
||||
|
||||
imgLoader* mLoader;
|
||||
RefPtr<imgRequest> mRequest;
|
||||
uint32_t mDataSize;
|
||||
|
Loading…
Reference in New Issue
Block a user