Fixing anticipated bustage due to thread safety checking code.

git-svn-id: svn://10.0.0.236/trunk@62251 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
warren%netscape.com
2000-03-06 00:08:26 +00:00
parent f8d3a7a35f
commit f208a25dc3
3 changed files with 16 additions and 109 deletions

View File

@@ -30,6 +30,8 @@
class nsSplashScreenMac : public nsISplashScreen {
public:
NS_DECL_ISUPPORTS
nsSplashScreenMac()
: mDialog( 0 ), mPicHandle( 0 ), mRefCnt( 0 ) {
}
@@ -40,45 +42,12 @@ public:
NS_IMETHOD Show();
NS_IMETHOD Hide();
// nsISupports methods
NS_IMETHOD_(nsrefcnt) AddRef() {
mRefCnt++;
return mRefCnt;
}
NS_IMETHOD_(nsrefcnt) Release() {
--mRefCnt;
if ( !mRefCnt ) {
delete this;
return 0;
}
return mRefCnt;
}
NS_IMETHOD QueryInterface( const nsIID &iid, void**p ) {
nsresult rv = NS_OK;
if ( p ) {
*p = 0;
if ( iid.Equals( NS_GET_IID( nsISplashScreen ) ) ) {
nsISplashScreen *result = this;
*p = result;
NS_ADDREF( result );
} else if ( iid.Equals( NS_GET_IID( nsISupports ) ) ) {
nsISupports *result = NS_STATIC_CAST( nsISupports*, this );
*p = result;
NS_ADDREF( result );
} else {
rv = NS_NOINTERFACE;
}
} else {
rv = NS_ERROR_NULL_POINTER;
}
return rv;
}
DialogPtr mDialog;
PicHandle mPicHandle;
nsrefcnt mRefCnt;
}; // class nsSplashScreenMac
NS_IMPL_ISUPPORTS1(nsSplashScreenMac, nsISplashScreen)
NS_IMETHODIMP
nsSplashScreenMac::Show() {
mDialog = ::GetNewDialog( rSplashDialog, nil, (WindowPtr)-1L );
@@ -128,4 +97,4 @@ PRBool NS_CanRun()
return PR_FALSE;
}
return PR_TRUE;
}
}

View File

@@ -31,6 +31,8 @@
class nsSplashScreenPh : public nsISplashScreen {
public:
NS_DECL_ISUPPORTS
nsSplashScreenPh()
: mDialog( 0 ), mRefCnt( 0 ) {
@@ -48,44 +50,11 @@ public:
NS_IMETHOD Show();
NS_IMETHOD Hide();
// nsISupports methods
NS_IMETHOD_(nsrefcnt) AddRef() {
mRefCnt++;
return mRefCnt;
}
NS_IMETHOD_(nsrefcnt) Release() {
--mRefCnt;
if ( !mRefCnt ) {
delete this;
return 0;
}
return mRefCnt;
}
NS_IMETHOD QueryInterface( const nsIID &iid, void**p ) {
nsresult rv = NS_OK;
if ( p ) {
*p = 0;
if ( iid.Equals( NS_GET_IID( nsISplashScreen ) ) ) {
nsISplashScreen *result = this;
*p = result;
NS_ADDREF( result );
} else if ( iid.Equals( NS_GET_IID( nsISupports ) ) ) {
nsISupports *result = NS_STATIC_CAST( nsISupports*, this );
*p = result;
NS_ADDREF( result );
} else {
rv = NS_NOINTERFACE;
}
} else {
rv = NS_ERROR_NULL_POINTER;
}
return rv;
}
PtWidget_t *mDialog;
nsrefcnt mRefCnt;
}; // class nsSplashScreenPh
NS_IMPL_ISUPPORTS1(nsSplashScreenPh, nsISplashScreen)
NS_IMETHODIMP
nsSplashScreenPh::Show()
{
@@ -178,4 +147,4 @@ nsresult NS_CreateSplashScreen(nsISplashScreen**aResult)
PRBool NS_CanRun()
{
return PR_TRUE;
}
}

View File

@@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
@@ -30,46 +30,14 @@
class nsSplashScreenWin : public nsISplashScreen {
public:
NS_DECL_ISUPPORTS
nsSplashScreenWin();
~nsSplashScreenWin();
NS_IMETHOD Show();
NS_IMETHOD Hide();
// nsISupports methods
NS_IMETHOD_(nsrefcnt) AddRef() {
mRefCnt++;
return mRefCnt;
}
NS_IMETHOD_(nsrefcnt) Release() {
--mRefCnt;
if ( !mRefCnt ) {
delete this;
return 0;
}
return mRefCnt;
}
NS_IMETHOD QueryInterface( const nsIID &iid, void**p ) {
nsresult rv = NS_OK;
if ( p ) {
*p = 0;
if ( iid.Equals( NS_GET_IID( nsISplashScreen ) ) ) {
nsISplashScreen *result = this;
*p = result;
NS_ADDREF( result );
} else if ( iid.Equals( NS_GET_IID( nsISupports ) ) ) {
nsISupports *result = NS_STATIC_CAST( nsISupports*, this );
*p = result;
NS_ADDREF( result );
} else {
rv = NS_NOINTERFACE;
}
} else {
rv = NS_ERROR_NULL_POINTER;
}
return rv;
}
void SetDialog( HWND dlg );
static void CheckConsole();
static nsSplashScreenWin* GetPointer( HWND dlg );
@@ -79,9 +47,10 @@ public:
static DWORD WINAPI ThreadProc( LPVOID );
HWND mDlg;
nsrefcnt mRefCnt;
}; // class nsSplashScreenWin
NS_IMPL_ISUPPORTS1(nsSplashScreenWin, nsISplashScreen)
nsSplashScreenWin::nsSplashScreenWin()
: mRefCnt( 0 ), mDlg( 0 ) {
}
@@ -293,4 +262,4 @@ nsresult NS_CreateSplashScreen( nsISplashScreen **aResult ) {
PRBool NS_CanRun()
{
return PR_TRUE;
}
}