зеркало из https://github.com/mozilla/gecko-dev.git
Bug 984786 part 3: Mark refcounted classes RDFBindingSet and DataOwner as MOZ_FINAL and make their destructors private. r=bent
This commit is contained in:
Родитель
73ae25ea89
Коммит
c79bb6271d
|
@ -400,7 +400,7 @@ protected:
|
|||
friend class DataOwnerAdapter;
|
||||
friend class nsDOMMemoryFileDataOwnerMemoryReporter;
|
||||
|
||||
class DataOwner : public mozilla::LinkedListElement<DataOwner> {
|
||||
class DataOwner MOZ_FINAL : public mozilla::LinkedListElement<DataOwner> {
|
||||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DataOwner)
|
||||
DataOwner(void* aMemoryBuffer, uint64_t aLength)
|
||||
|
@ -416,6 +416,8 @@ protected:
|
|||
sDataOwners->insertBack(this);
|
||||
}
|
||||
|
||||
private:
|
||||
// Private destructor, to discourage deletion outside of Release():
|
||||
~DataOwner() {
|
||||
mozilla::StaticMutexAutoLock lock(sDataOwnerMutex);
|
||||
|
||||
|
@ -428,6 +430,7 @@ protected:
|
|||
moz_free(mData);
|
||||
}
|
||||
|
||||
public:
|
||||
static void EnsureMemoryReporterRegistered();
|
||||
|
||||
// sDataOwners and sMemoryReporterRegistered may only be accessed while
|
||||
|
|
|
@ -61,9 +61,11 @@ private:
|
|||
* a collection of <binding> descriptors. This object is refcounted by
|
||||
* nsBindingValues objects and the query processor.
|
||||
*/
|
||||
class RDFBindingSet
|
||||
class RDFBindingSet MOZ_FINAL
|
||||
{
|
||||
protected:
|
||||
private:
|
||||
// Private destructor, to discourage deletion outside of Release():
|
||||
~RDFBindingSet();
|
||||
|
||||
// the number of bindings
|
||||
int32_t mCount;
|
||||
|
@ -80,8 +82,6 @@ public:
|
|||
MOZ_COUNT_CTOR(RDFBindingSet);
|
||||
}
|
||||
|
||||
~RDFBindingSet();
|
||||
|
||||
NS_INLINE_DECL_REFCOUNTING(RDFBindingSet)
|
||||
|
||||
int32_t Count() const { return mCount; }
|
||||
|
|
Загрузка…
Ссылка в новой задаче