mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1004564 - Move AtomicRefCounted to mozilla::external and outlaw it in Gecko code; r=froydnj
This commit is contained in:
parent
0b87d37000
commit
ef0b7d19aa
@ -179,12 +179,17 @@ class RefCounted : public detail::RefCounted<T, detail::NonAtomicRefCount>
|
||||
}
|
||||
};
|
||||
|
||||
namespace external {
|
||||
|
||||
/**
|
||||
* AtomicRefCounted<T> is like RefCounted<T>, with an atomically updated
|
||||
* reference counter.
|
||||
*
|
||||
* NOTE: Please do not use this class, use NS_INLINE_DECL_THREADSAFE_REFCOUNTING
|
||||
* instead.
|
||||
*/
|
||||
template<typename T>
|
||||
class AtomicRefCounted : public detail::RefCounted<T, detail::AtomicRefCount>
|
||||
class AtomicRefCounted : public mozilla::detail::RefCounted<T, mozilla::detail::AtomicRefCount>
|
||||
{
|
||||
public:
|
||||
~AtomicRefCounted() {
|
||||
@ -193,6 +198,8 @@ class AtomicRefCounted : public detail::RefCounted<T, detail::AtomicRefCount>
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* RefPtr points to a refcounted thing that has AddRef and Release
|
||||
* methods to increase/decrease the refcount, respectively. After a
|
||||
|
@ -88,7 +88,7 @@ template <> inline RefCounted<LibHandle, AtomicRefCount>::~RefCounted()
|
||||
* Abstract class for loaded libraries. Libraries may be loaded through the
|
||||
* system linker or this linker, both cases will be derived from this class.
|
||||
*/
|
||||
class LibHandle: public mozilla::AtomicRefCounted<LibHandle>
|
||||
class LibHandle: public mozilla::external::AtomicRefCounted<LibHandle>
|
||||
{
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(LibHandle)
|
||||
@ -140,7 +140,7 @@ public:
|
||||
void AddDirectRef()
|
||||
{
|
||||
++directRefCnt;
|
||||
mozilla::AtomicRefCounted<LibHandle>::AddRef();
|
||||
mozilla::external::AtomicRefCounted<LibHandle>::AddRef();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -152,10 +152,10 @@ public:
|
||||
bool ret = false;
|
||||
if (directRefCnt) {
|
||||
MOZ_ASSERT(directRefCnt <=
|
||||
mozilla::AtomicRefCounted<LibHandle>::refCount());
|
||||
mozilla::external::AtomicRefCounted<LibHandle>::refCount());
|
||||
if (--directRefCnt)
|
||||
ret = true;
|
||||
mozilla::AtomicRefCounted<LibHandle>::Release();
|
||||
mozilla::external::AtomicRefCounted<LibHandle>::Release();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ class ZipCollection;
|
||||
* libraries from Zip archives, there is no interest in making this code
|
||||
* safe, since the libraries could contain malicious code anyways.
|
||||
*/
|
||||
class Zip: public mozilla::AtomicRefCounted<Zip>
|
||||
class Zip: public mozilla::external::AtomicRefCounted<Zip>
|
||||
{
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(Zip)
|
||||
|
Loading…
Reference in New Issue
Block a user