зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1116905 - part 4 - remove implicit conversion from non-nullptr T* to TemporaryRef<T>; r=ehsan
This commit is contained in:
Родитель
c24f5f4e7c
Коммит
2e9c6d19f2
|
@ -13,6 +13,7 @@
|
|||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/RefCountType.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
#if defined(MOZILLA_INTERNAL_API)
|
||||
|
@ -327,7 +328,13 @@ class TemporaryRef
|
|||
typedef typename RefPtr<T>::DontRef DontRef;
|
||||
|
||||
public:
|
||||
MOZ_IMPLICIT TemporaryRef(T* aVal) : mPtr(RefPtr<T>::ref(aVal)) {}
|
||||
// Please see already_AddRefed for a description of what these constructors
|
||||
// do.
|
||||
TemporaryRef() : mPtr(nullptr) {}
|
||||
typedef void (TemporaryRef::* MatchNullptr)(double, float);
|
||||
MOZ_IMPLICIT TemporaryRef(MatchNullptr aRawPtr) : mPtr(nullptr) {}
|
||||
explicit TemporaryRef(T* aVal) : mPtr(RefPtr<T>::ref(aVal)) {}
|
||||
|
||||
TemporaryRef(const TemporaryRef& aOther) : mPtr(aOther.take()) {}
|
||||
|
||||
template<typename U>
|
||||
|
@ -347,7 +354,6 @@ private:
|
|||
|
||||
mutable T* MOZ_OWNING_REF mPtr;
|
||||
|
||||
TemporaryRef() = delete;
|
||||
void operator=(const TemporaryRef&) = delete;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче