From 38d6c0d45502bcc4c4cf5db8c1b4d28ad1045c41 Mon Sep 17 00:00:00 2001 From: Arnaud Sourioux Date: Fri, 19 Jul 2013 12:53:12 -0400 Subject: [PATCH] Bug 883360 - Remove bool operator and nsMainThreadPtrHolder conversion. r=bsmedberg --- netwerk/base/src/nsServerSocket.cpp | 4 ++-- netwerk/base/src/nsUDPServerSocket.cpp | 4 ++-- netwerk/dns/nsDNSService2.cpp | 2 +- .../url-classifier/nsUrlClassifierProxies.h | 14 +++++++------- xpcom/glue/nsProxyRelease.h | 4 ---- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/netwerk/base/src/nsServerSocket.cpp b/netwerk/base/src/nsServerSocket.cpp index 909968ba42c5..84fd506f07ed 100644 --- a/netwerk/base/src/nsServerSocket.cpp +++ b/netwerk/base/src/nsServerSocket.cpp @@ -370,7 +370,7 @@ public: class OnSocketAcceptedRunnable : public nsRunnable { public: - OnSocketAcceptedRunnable(nsMainThreadPtrHolder* aListener, + OnSocketAcceptedRunnable(const nsMainThreadPtrHandle& aListener, nsIServerSocket* aServ, nsISocketTransport* aTransport) : mListener(aListener) @@ -389,7 +389,7 @@ public: class OnStopListeningRunnable : public nsRunnable { public: - OnStopListeningRunnable(nsMainThreadPtrHolder* aListener, + OnStopListeningRunnable(const nsMainThreadPtrHandle& aListener, nsIServerSocket* aServ, nsresult aStatus) : mListener(aListener) diff --git a/netwerk/base/src/nsUDPServerSocket.cpp b/netwerk/base/src/nsUDPServerSocket.cpp index d0fa2016ee92..26c534a30c5d 100644 --- a/netwerk/base/src/nsUDPServerSocket.cpp +++ b/netwerk/base/src/nsUDPServerSocket.cpp @@ -523,7 +523,7 @@ public: class OnPacketReceivedRunnable : public nsRunnable { public: - OnPacketReceivedRunnable(nsMainThreadPtrHolder* aListener, + OnPacketReceivedRunnable(const nsMainThreadPtrHandle& aListener, nsIUDPServerSocket* aServ, nsIUDPMessage* aMessage) : mListener(aListener) @@ -542,7 +542,7 @@ public: class OnStopListeningRunnable : public nsRunnable { public: - OnStopListeningRunnable(nsMainThreadPtrHolder* aListener, + OnStopListeningRunnable(const nsMainThreadPtrHandle& aListener, nsIUDPServerSocket* aServ, nsresult aStatus) : mListener(aListener) diff --git a/netwerk/dns/nsDNSService2.cpp b/netwerk/dns/nsDNSService2.cpp index feeada05d81c..64dd0bf0e3a5 100644 --- a/netwerk/dns/nsDNSService2.cpp +++ b/netwerk/dns/nsDNSService2.cpp @@ -538,7 +538,7 @@ public: class OnLookupCompleteRunnable : public nsRunnable { public: - OnLookupCompleteRunnable(nsMainThreadPtrHolder* aListener, + OnLookupCompleteRunnable(const nsMainThreadPtrHandle& aListener, nsICancelable* aRequest, nsIDNSRecord* aRecord, nsresult aStatus) diff --git a/toolkit/components/url-classifier/nsUrlClassifierProxies.h b/toolkit/components/url-classifier/nsUrlClassifierProxies.h index 2b5c7547f5bf..edcaca5d025a 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierProxies.h +++ b/toolkit/components/url-classifier/nsUrlClassifierProxies.h @@ -171,7 +171,7 @@ public: class LookupCompleteRunnable : public nsRunnable { public: - LookupCompleteRunnable(nsMainThreadPtrHolder* aTarget, + LookupCompleteRunnable(const nsMainThreadPtrHandle& aTarget, mozilla::safebrowsing::LookupResultArray *aResults) : mTarget(aTarget) , mResults(aResults) @@ -201,7 +201,7 @@ public: class HandleEventRunnable : public nsRunnable { public: - HandleEventRunnable(nsMainThreadPtrHolder* aTarget, + HandleEventRunnable(const nsMainThreadPtrHandle& aTarget, const nsACString& aValue) : mTarget(aTarget) , mValue(aValue) @@ -232,7 +232,7 @@ public: class UpdateUrlRequestedRunnable : public nsRunnable { public: - UpdateUrlRequestedRunnable(nsMainThreadPtrHolder* aTarget, + UpdateUrlRequestedRunnable(const nsMainThreadPtrHandle& aTarget, const nsACString& aURL, const nsACString& aTable, const nsACString& aServerMAC) @@ -252,7 +252,7 @@ public: class RekeyRequestedRunnable : public nsRunnable { public: - RekeyRequestedRunnable(nsMainThreadPtrHolder* aTarget) + RekeyRequestedRunnable(const nsMainThreadPtrHandle& aTarget) : mTarget(aTarget) { } @@ -265,7 +265,7 @@ public: class StreamFinishedRunnable : public nsRunnable { public: - StreamFinishedRunnable(nsMainThreadPtrHolder* aTarget, + StreamFinishedRunnable(const nsMainThreadPtrHandle& aTarget, nsresult aStatus, uint32_t aDelay) : mTarget(aTarget) , mStatus(aStatus) @@ -283,7 +283,7 @@ public: class UpdateErrorRunnable : public nsRunnable { public: - UpdateErrorRunnable(nsMainThreadPtrHolder* aTarget, + UpdateErrorRunnable(const nsMainThreadPtrHandle& aTarget, nsresult aError) : mTarget(aTarget) , mError(aError) @@ -299,7 +299,7 @@ public: class UpdateSuccessRunnable : public nsRunnable { public: - UpdateSuccessRunnable(nsMainThreadPtrHolder* aTarget, + UpdateSuccessRunnable(const nsMainThreadPtrHandle& aTarget, uint32_t aRequestedTimeout) : mTarget(aTarget) , mRequestedTimeout(aRequestedTimeout) diff --git a/xpcom/glue/nsProxyRelease.h b/xpcom/glue/nsProxyRelease.h index 3ba9faab256f..87723761b5f5 100644 --- a/xpcom/glue/nsProxyRelease.h +++ b/xpcom/glue/nsProxyRelease.h @@ -180,8 +180,6 @@ class nsMainThreadPtrHandle return *this; } - operator nsMainThreadPtrHolder*() { return mPtr.get(); } - // These all call through to nsMainThreadPtrHolder, and thus implicitly // assert that we're on the main thread. Off-main-thread consumers must treat // these handles as opaque. @@ -203,8 +201,6 @@ class nsMainThreadPtrHandle operator T*() { return get(); } T* operator->() { return get(); } - operator bool() { return get(); } - // These are safe to call on other threads with appropriate external locking. bool operator==(const nsMainThreadPtrHandle& aOther) const { if (!mPtr || !aOther.mPtr)