diff --git a/mozilla/xpfe/appshell/public/nsIAppShellService.h b/mozilla/xpfe/appshell/public/nsIAppShellService.h index ed3c59e5c20..123775208ba 100644 --- a/mozilla/xpfe/appshell/public/nsIAppShellService.h +++ b/mozilla/xpfe/appshell/public/nsIAppShellService.h @@ -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, diff --git a/mozilla/xpfe/appshell/src/nsAppShellService.cpp b/mozilla/xpfe/appshell/src/nsAppShellService.cpp index 922288c4627..cd6a7bd36b0 100644 --- a/mozilla/xpfe/appshell/src/nsAppShellService.cpp +++ b/mozilla/xpfe/appshell/src/nsAppShellService.cpp @@ -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 );