зеркало из https://github.com/mozilla/gecko-dev.git
fix xpcom code
This commit is contained in:
Родитель
b718155791
Коммит
e0f54be853
|
@ -19,15 +19,21 @@
|
|||
|
||||
#include "nsJISx4501LineBreaker.h"
|
||||
|
||||
NS_DEFINE_IID(kILineBreaker, NS_ILINEBREAKER_IID);
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsJISx4501LineBreaker, NS_ILINEBREAKER_IID);
|
||||
|
||||
|
||||
|
||||
|
||||
#include "pratom.h"
|
||||
#include "nsLWBRKDll.h"
|
||||
nsJISx4501LineBreaker::nsJISx4501LineBreaker()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
PR_AtomicIncrement(&g_InstanceCount);
|
||||
}
|
||||
nsJISx4501LineBreaker::~nsJISx4501LineBreaker()
|
||||
{
|
||||
PR_AtomicDecrement(&g_InstanceCount);
|
||||
}
|
||||
|
||||
NS_DEFINE_IID(kILineBreakerIID, NS_ILINEBREAKER_IID);
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsJISx4501LineBreaker, kILineBreakerIID);
|
||||
|
||||
nsresult nsJISx4501LineBreaker::BreakInBetween(
|
||||
PRUnichar* aText1 , PRUint32 aTextLen1,
|
||||
|
|
|
@ -25,9 +25,8 @@ class nsJISx4501LineBreaker : public nsILineBreaker
|
|||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
nsJISx4501LineBreaker() {
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
nsJISx4501LineBreaker();
|
||||
~nsJISx4501LineBreaker();
|
||||
|
||||
NS_IMETHOD BreakInBetween(PRUnichar* aText1 , PRUint32 aTextLen1,
|
||||
PRUnichar* aText2 , PRUint32 aTextLen2,
|
||||
|
|
|
@ -20,11 +20,23 @@
|
|||
|
||||
#include "nsLWIMP.h"
|
||||
|
||||
#include "pratom.h"
|
||||
#include "nsLWBRKDll.h"
|
||||
nsLWBreakerFImp::nsLWBreakerFImp()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
PR_AtomicIncrement(&g_InstanceCount);
|
||||
}
|
||||
nsLWBreakerFImp::~nsLWBreakerFImp()
|
||||
{
|
||||
PR_AtomicDecrement(&g_InstanceCount);
|
||||
}
|
||||
|
||||
NS_DEFINE_IID(kILineBreakerFactoryIID, NS_ILINEBREAKERFACTORY_IID);
|
||||
NS_DEFINE_IID(kIWordBreakerFactoryIID, NS_ILINEBREAKERFACTORY_IID);
|
||||
NS_DEFINE_IID(kILineBreakerIID, NS_ILINEBREAKER_IID);
|
||||
NS_DEFINE_IID(kIWordBreakerIID, NS_ILINEBREAKER_IID);
|
||||
NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
|
||||
NS_IMPL_ADDREF ( nsLWBreakerFImp );
|
||||
|
@ -48,7 +60,6 @@ nsresult nsLWBreakerFImp::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
if( aIID.Equals ( kISupportsIID )) {
|
||||
*aInstancePtr = (void*) (this);
|
||||
|
|
|
@ -34,9 +34,8 @@ class nsLWBreakerFImp : public nsILineBreakerFactory , nsIWordBreakerFactory
|
|||
|
||||
public:
|
||||
|
||||
nsLWBreakerFImp() {
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
nsLWBreakerFImp();
|
||||
~nsLWBreakerFImp();
|
||||
|
||||
NS_IMETHOD GetBreaker(nsString& aParam, nsILineBreaker** breaker);
|
||||
NS_IMETHOD GetBreaker(nsString& aParam, nsIWordBreaker** breaker);
|
||||
|
|
|
@ -29,20 +29,18 @@
|
|||
NS_DEFINE_CID(kLWBrkCID, NS_LWBRK_CID);
|
||||
|
||||
NS_DEFINE_IID(kFactoryIID, NS_IFACTORY_IID);
|
||||
NS_DEFINE_IID(kILineBreakerFactoryIID, NS_ILINEBREAKERFACTORY_IID);
|
||||
NS_DEFINE_IID(kIWordBreakerFactoryIID, NS_IWORDBREAKERFACTORY_IID);
|
||||
|
||||
static PRInt32 g_FactoryCount = 0;
|
||||
static PRInt32 g_LockCount = 0;
|
||||
extern "C" PRInt32 g_InstanceCount = 0;
|
||||
extern "C" PRInt32 g_LockCount = 0;
|
||||
|
||||
class nsLWBrkFactory : public nsIFactory {
|
||||
NS_DECL_ISUPPORTS
|
||||
nsLWBrkFactory() {
|
||||
NS_INIT_REFCNT();
|
||||
PR_AtomicIncrement(&g_FactoryCount);
|
||||
PR_AtomicIncrement(&g_InstanceCount);
|
||||
};
|
||||
~nsLWBrkFactory() {
|
||||
PR_AtomicDecrement(&g_FactoryCount);
|
||||
PR_AtomicDecrement(&g_InstanceCount);
|
||||
};
|
||||
|
||||
NS_IMETHOD CreateInstance(nsISupports *aDelegate,
|
||||
|
@ -100,7 +98,7 @@ extern "C" NS_EXPORT nsresult NSGetFactory(const nsCID &aCID, nsISupports* servi
|
|||
}
|
||||
|
||||
extern "C" NS_EXPORT PRBool NSCanUnload() {
|
||||
return PRBool(g_FactoryCount == 0 && g_LockCount == 0);
|
||||
return PRBool(g_InstanceCount == 0 && g_LockCount == 0);
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT nsresult NSRegisterSelf(const char *path)
|
||||
|
|
|
@ -19,9 +19,21 @@
|
|||
|
||||
#include "nsSampleWordBreaker.h"
|
||||
|
||||
NS_DEFINE_IID(kIWordBreaker, NS_IWORDBREAKER_IID);
|
||||
#include "pratom.h"
|
||||
#include "nsLWBRKDll.h"
|
||||
nsSampleWordBreaker::nsSampleWordBreaker()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
PR_AtomicIncrement(&g_InstanceCount);
|
||||
}
|
||||
nsSampleWordBreaker::~nsSampleWordBreaker()
|
||||
{
|
||||
PR_AtomicDecrement(&g_InstanceCount);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsSampleWordBreaker, NS_IWORDBREAKER_IID);
|
||||
NS_DEFINE_IID(kIWordBreakerIID, NS_IWORDBREAKER_IID);
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsSampleWordBreaker, kIWordBreakerIID);
|
||||
|
||||
nsresult nsSampleWordBreaker::BreakInBetween(
|
||||
PRUnichar* aText1 , PRUint32 aTextLen1,
|
||||
|
|
|
@ -25,9 +25,8 @@ class nsSampleWordBreaker : public nsIWordBreaker
|
|||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
nsSampleWordBreaker() {
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
nsSampleWordBreaker() ;
|
||||
~nsSampleWordBreaker() ;
|
||||
|
||||
NS_IMETHOD BreakInBetween(PRUnichar* aText1 , PRUint32 aTextLen1,
|
||||
PRUnichar* aText2 , PRUint32 aTextLen2,
|
||||
|
|
Загрузка…
Ссылка в новой задаче