adding access to primordial thread

This commit is contained in:
danm%netscape.com 1999-06-11 03:44:52 +00:00
parent 3937d3f3d0
commit a94047bcd2
2 changed files with 11 additions and 0 deletions

View File

@ -25,6 +25,7 @@
#include "nsISupports.h"
/* Forward declarations... */
struct PRThread;
class nsIFactory;
class nsIURL;
class nsIWebShellWindow;
@ -47,6 +48,7 @@ public:
NS_IMETHOD Initialize(nsICmdLineService * aCmdLineService) = 0;
NS_IMETHOD Run(void) = 0;
NS_IMETHOD Shutdown(void) = 0;
NS_IMETHOD GetPrimordialThread(PRThread **aThread) = 0;
NS_IMETHOD CreateTopLevelWindow(nsIWebShellWindow * aParent,
nsIURL* aUrl,

View File

@ -93,6 +93,9 @@ public:
NS_IMETHOD Initialize(nsICmdLineService*aCmdLineService);
NS_IMETHOD Run(void);
NS_IMETHOD Shutdown(void);
NS_IMETHOD GetPrimordialThread(PRThread **aThread)
{ *aThread = mPrimordialThread; return NS_OK; }
NS_IMETHOD CreateTopLevelWindow(nsIWebShellWindow * aParent,
nsIURL* aUrl,
PRBool showWindow,
@ -125,6 +128,7 @@ protected:
nsIAppShell* mAppShell;
nsISupportsArray* mWindowList;
nsICmdLineService* mCmdLineService;
PRThread* mPrimordialThread;
};
@ -135,6 +139,7 @@ nsAppShellService::nsAppShellService()
mAppShell = nsnull;
mWindowList = nsnull;
mCmdLineService = nsnull;
mPrimordialThread = nsnull;
}
nsAppShellService::~nsAppShellService()
@ -162,6 +167,10 @@ nsAppShellService::Initialize( nsICmdLineService *aCmdLineService )
#ifdef MOZ_FULLCIRCLE
FCInitialize();
#endif
// assume no new threads have been spun up yet, or at least if they have,
// they haven't been made the current one
mPrimordialThread = PR_CurrentThread();
// Remember cmd line service.
mCmdLineService = aCmdLineService;
NS_IF_ADDREF( mCmdLineService );