зеркало из https://github.com/mozilla/pjs.git
fix WeakReference exporting for Windows. a:chofmann r:scc.
This commit is contained in:
Родитель
1af9ed60fe
Коммит
4b3daedbe5
|
@ -19,7 +19,8 @@ interface nsISupportsWeakReference : nsISupports
|
||||||
// typedef nsCOMPtr<nsIWeakReference> nsWeakPtr;
|
// typedef nsCOMPtr<nsIWeakReference> nsWeakPtr;
|
||||||
// ...this definition had to be moved to nsWeakPtr.h to avoid circular includes, sorry
|
// ...this definition had to be moved to nsWeakPtr.h to avoid circular includes, sorry
|
||||||
|
|
||||||
nsIWeakReference* NS_GetWeakReference( nsISupports* , nsresult* aResult = 0);
|
extern NS_COM nsIWeakReference*
|
||||||
|
NS_GetWeakReference( nsISupports* , nsresult* aResult = 0);
|
||||||
// ...convenience. Get a weak reference (if possible) without doing the query yourself
|
// ...convenience. Get a weak reference (if possible) without doing the query yourself
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "nsWeakReference.h"
|
#include "nsWeakReference.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
nsIWeakReference*
|
NS_COM nsIWeakReference *
|
||||||
NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
|
NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
|
||||||
{
|
{
|
||||||
nsresult status;
|
nsresult status;
|
||||||
|
@ -18,7 +18,7 @@ NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
|
||||||
return weakP;
|
return weakP;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
NS_IMETHODIMP
|
||||||
nsSupportsWeakReference::GetWeakReference( nsIWeakReference** aInstancePtr )
|
nsSupportsWeakReference::GetWeakReference( nsIWeakReference** aInstancePtr )
|
||||||
{
|
{
|
||||||
if ( !aInstancePtr )
|
if ( !aInstancePtr )
|
||||||
|
@ -40,13 +40,13 @@ nsSupportsWeakReference::GetWeakReference( nsIWeakReference** aInstancePtr )
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsrefcnt
|
NS_IMETHODIMP_(nsrefcnt)
|
||||||
nsWeakReference::AddRef()
|
nsWeakReference::AddRef()
|
||||||
{
|
{
|
||||||
return ++mRefCount;
|
return ++mRefCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsrefcnt
|
NS_IMETHODIMP_(nsrefcnt)
|
||||||
nsWeakReference::Release()
|
nsWeakReference::Release()
|
||||||
{
|
{
|
||||||
nsrefcnt temp = --mRefCount;
|
nsrefcnt temp = --mRefCount;
|
||||||
|
@ -55,7 +55,7 @@ nsWeakReference::Release()
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
NS_IMETHODIMP
|
||||||
nsWeakReference::QueryInterface( const nsIID& aIID, void** aInstancePtr )
|
nsWeakReference::QueryInterface( const nsIID& aIID, void** aInstancePtr )
|
||||||
{
|
{
|
||||||
if ( !aInstancePtr )
|
if ( !aInstancePtr )
|
||||||
|
@ -80,7 +80,7 @@ nsWeakReference::QueryInterface( const nsIID& aIID, void** aInstancePtr )
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
NS_IMETHODIMP
|
||||||
nsWeakReference::QueryReference( const nsIID& aIID, void** aInstancePtr )
|
nsWeakReference::QueryReference( const nsIID& aIID, void** aInstancePtr )
|
||||||
{
|
{
|
||||||
return mReferent ? mReferent->QueryInterface(aIID, aInstancePtr) : NS_ERROR_NULL_POINTER;
|
return mReferent ? mReferent->QueryInterface(aIID, aInstancePtr) : NS_ERROR_NULL_POINTER;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "nsIWeakReference.h"
|
#include "nsIWeakReference.h"
|
||||||
|
|
||||||
class nsSupportsWeakReference : public nsISupportsWeakReference
|
class NS_COM nsSupportsWeakReference : public nsISupportsWeakReference
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsSupportsWeakReference()
|
nsSupportsWeakReference()
|
||||||
|
@ -31,7 +31,7 @@ class nsSupportsWeakReference : public nsISupportsWeakReference
|
||||||
nsWeakReference* mProxy;
|
nsWeakReference* mProxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
class nsWeakReference : public nsIWeakReference
|
class NS_COM nsWeakReference : public nsIWeakReference
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// nsISupports...
|
// nsISupports...
|
||||||
|
@ -72,8 +72,7 @@ class nsWeakReference : public nsIWeakReference
|
||||||
nsSupportsWeakReference* mReferent;
|
nsSupportsWeakReference* mReferent;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline
|
inline nsSupportsWeakReference::~nsSupportsWeakReference()
|
||||||
nsSupportsWeakReference::~nsSupportsWeakReference()
|
|
||||||
{
|
{
|
||||||
if ( mProxy )
|
if ( mProxy )
|
||||||
mProxy->NoticeReferentDestruction();
|
mProxy->NoticeReferentDestruction();
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#include "nsAVLTree.h"
|
#include "nsAVLTree.h"
|
||||||
#include "nsHashtableEnumerator.h"
|
#include "nsHashtableEnumerator.h"
|
||||||
#include "nsPipe2.h"
|
#include "nsPipe2.h"
|
||||||
|
#include "nsWeakReference.h"
|
||||||
|
|
||||||
class dummyComparitor: public nsAVLNodeComparitor {
|
class dummyComparitor: public nsAVLNodeComparitor {
|
||||||
public:
|
public:
|
||||||
|
@ -99,6 +100,7 @@ void XXXNeverCalled()
|
||||||
XPTI_GetInterfaceInfoManager();
|
XPTI_GetInterfaceInfoManager();
|
||||||
NS_NewGenericFactory(NULL, NULL, NULL);
|
NS_NewGenericFactory(NULL, NULL, NULL);
|
||||||
NS_NewHashtableEnumerator(NULL, NULL, NULL, NULL);
|
NS_NewHashtableEnumerator(NULL, NULL, NULL, NULL);
|
||||||
|
NS_GetWeakReference(NULL);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
TestSegmentedBuffer();
|
TestSegmentedBuffer();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "nsWeakReference.h"
|
#include "nsWeakReference.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
nsIWeakReference*
|
NS_COM nsIWeakReference *
|
||||||
NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
|
NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
|
||||||
{
|
{
|
||||||
nsresult status;
|
nsresult status;
|
||||||
|
@ -18,7 +18,7 @@ NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
|
||||||
return weakP;
|
return weakP;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
NS_IMETHODIMP
|
||||||
nsSupportsWeakReference::GetWeakReference( nsIWeakReference** aInstancePtr )
|
nsSupportsWeakReference::GetWeakReference( nsIWeakReference** aInstancePtr )
|
||||||
{
|
{
|
||||||
if ( !aInstancePtr )
|
if ( !aInstancePtr )
|
||||||
|
@ -40,13 +40,13 @@ nsSupportsWeakReference::GetWeakReference( nsIWeakReference** aInstancePtr )
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsrefcnt
|
NS_IMETHODIMP_(nsrefcnt)
|
||||||
nsWeakReference::AddRef()
|
nsWeakReference::AddRef()
|
||||||
{
|
{
|
||||||
return ++mRefCount;
|
return ++mRefCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsrefcnt
|
NS_IMETHODIMP_(nsrefcnt)
|
||||||
nsWeakReference::Release()
|
nsWeakReference::Release()
|
||||||
{
|
{
|
||||||
nsrefcnt temp = --mRefCount;
|
nsrefcnt temp = --mRefCount;
|
||||||
|
@ -55,7 +55,7 @@ nsWeakReference::Release()
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
NS_IMETHODIMP
|
||||||
nsWeakReference::QueryInterface( const nsIID& aIID, void** aInstancePtr )
|
nsWeakReference::QueryInterface( const nsIID& aIID, void** aInstancePtr )
|
||||||
{
|
{
|
||||||
if ( !aInstancePtr )
|
if ( !aInstancePtr )
|
||||||
|
@ -80,7 +80,7 @@ nsWeakReference::QueryInterface( const nsIID& aIID, void** aInstancePtr )
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
NS_IMETHODIMP
|
||||||
nsWeakReference::QueryReference( const nsIID& aIID, void** aInstancePtr )
|
nsWeakReference::QueryReference( const nsIID& aIID, void** aInstancePtr )
|
||||||
{
|
{
|
||||||
return mReferent ? mReferent->QueryInterface(aIID, aInstancePtr) : NS_ERROR_NULL_POINTER;
|
return mReferent ? mReferent->QueryInterface(aIID, aInstancePtr) : NS_ERROR_NULL_POINTER;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "nsIWeakReference.h"
|
#include "nsIWeakReference.h"
|
||||||
|
|
||||||
class nsSupportsWeakReference : public nsISupportsWeakReference
|
class NS_COM nsSupportsWeakReference : public nsISupportsWeakReference
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsSupportsWeakReference()
|
nsSupportsWeakReference()
|
||||||
|
@ -31,7 +31,7 @@ class nsSupportsWeakReference : public nsISupportsWeakReference
|
||||||
nsWeakReference* mProxy;
|
nsWeakReference* mProxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
class nsWeakReference : public nsIWeakReference
|
class NS_COM nsWeakReference : public nsIWeakReference
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// nsISupports...
|
// nsISupports...
|
||||||
|
@ -72,8 +72,7 @@ class nsWeakReference : public nsIWeakReference
|
||||||
nsSupportsWeakReference* mReferent;
|
nsSupportsWeakReference* mReferent;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline
|
inline nsSupportsWeakReference::~nsSupportsWeakReference()
|
||||||
nsSupportsWeakReference::~nsSupportsWeakReference()
|
|
||||||
{
|
{
|
||||||
if ( mProxy )
|
if ( mProxy )
|
||||||
mProxy->NoticeReferentDestruction();
|
mProxy->NoticeReferentDestruction();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче