Bug 1316206 - Fix RefPtr assignments from 0 - r=froydnj

Giving '0' (literal zero) to RefPtr is now ambiguous, as both
RefPtr(decltype(nullptr)) and RefPtr(T*) could be used.
In any case, our coding standards mandate the use of 'nullptr' for pointers.
So I'm changing all zeroes into nullptr's where necessary.

MozReview-Commit-ID: A458A4e9for
This commit is contained in:
Gerald Squelart
2016-11-08 14:34:06 +11:00
parent 8788996603
commit 9d0ac8d6fb
10 changed files with 14 additions and 14 deletions

View File

@@ -255,8 +255,8 @@ class SpeechEvent : public Runnable
public:
SpeechEvent(SpeechRecognition* aRecognition, SpeechRecognition::EventType aType)
: mAudioSegment(0)
, mRecognitionResultList(0)
, mError(0)
, mRecognitionResultList(nullptr)
, mError(nullptr)
, mRecognition(aRecognition)
, mType(aType)
, mTrackRate(0)

View File

@@ -296,7 +296,7 @@ protected:
char16_t mChar;
WSPoint()
: mTextNode(0)
: mTextNode(nullptr)
, mOffset(0)
, mChar(0)
{}

View File

@@ -19,7 +19,7 @@ NS_IMPL_ISUPPORTS(nsTransactionList, nsITransactionList)
nsTransactionList::nsTransactionList(nsITransactionManager *aTxnMgr, nsTransactionStack *aTxnStack)
: mTxnStack(aTxnStack)
, mTxnItem(0)
, mTxnItem(nullptr)
{
if (aTxnMgr)
mTxnMgr = do_GetWeakReference(aTxnMgr);
@@ -36,7 +36,7 @@ nsTransactionList::nsTransactionList(nsITransactionManager *aTxnMgr, nsTransacti
nsTransactionList::~nsTransactionList()
{
mTxnStack = 0;
mTxnItem = 0;
mTxnItem = nullptr;
}
NS_IMETHODIMP nsTransactionList::GetNumItems(int32_t *aNumItems)

View File

@@ -38,7 +38,7 @@ public:
//-----------------------------------------------------------------------------
ObjectWatcher::ObjectWatcher() : watch_(NULL) {
ObjectWatcher::ObjectWatcher() : watch_(nullptr) {
}
ObjectWatcher::~ObjectWatcher() {
@@ -99,7 +99,7 @@ bool ObjectWatcher::StopWatching() {
// anything once it is run.
watch_->watcher = NULL;
watch_ = NULL;
watch_ = nullptr;
MessageLoop::current()->RemoveDestructionObserver(this);
return true;

View File

@@ -12,8 +12,8 @@ namespace base {
void BaseTimer_Helper::OrphanDelayedTask() {
if (delayed_task_) {
delayed_task_->timer_ = NULL;
delayed_task_ = NULL;
delayed_task_->timer_ = nullptr;
delayed_task_ = nullptr;
}
}

View File

@@ -176,7 +176,7 @@ class BaseTimer : public BaseTimer_Helper {
// Task is old. So, if the Timer points to a different task, assume
// that the Timer has already taken care of properly setting the task.
if (self->delayed_task_ == this)
self->delayed_task_ = NULL;
self->delayed_task_ = nullptr;
// By now the delayed_task_ in the Timer does not point to us anymore.
// We should reset our own timer_ because the Timer can not do this
// for us in its destructor.

View File

@@ -1413,7 +1413,7 @@ nsOfflineCacheDevice::Shutdown()
if (NS_FAILED(rv))
NS_WARNING("Failed to clean up namespaces.");
mEvictionFunction = 0;
mEvictionFunction = nullptr;
mStatement_CacheSize = nullptr;
mStatement_ApplicationCacheSize = nullptr;

View File

@@ -787,7 +787,7 @@ bool
HttpChannelParent::RecvDocumentChannelCleanup()
{
// From now on only using mAssociatedContentSecurity. Free everything else.
mChannel = 0; // Reclaim some memory sooner.
mChannel = nullptr; // Reclaim some memory sooner.
mCacheEntry = 0; // Else we'll block other channels reading same URI
return true;
}

View File

@@ -913,7 +913,7 @@ nsMultiMixedConv::SendStop(nsresult aStatus) {
(void) loadGroup->RemoveRequest(mPartChannel, mContext, aStatus);
}
mPartChannel = 0;
mPartChannel = nullptr;
return rv;
}

View File

@@ -40,7 +40,7 @@ public:
mHandler(aState);
// Break the cycle so the object can be destroyed.
mDeathGrip = 0;
mDeathGrip = nullptr;
}
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override