diff --git a/mozilla/widget/macbuild/Widget.prefix b/mozilla/widget/macbuild/Widget.prefix index 7e41bb923b5..1264cc03657 100644 --- a/mozilla/widget/macbuild/Widget.prefix +++ b/mozilla/widget/macbuild/Widget.prefix @@ -8,4 +8,6 @@ #include #include -#include \ No newline at end of file +#include + +#define USE_TLS_FOR_TOOLKIT 1 diff --git a/mozilla/widget/macbuild/WidgetDebug.prefix b/mozilla/widget/macbuild/WidgetDebug.prefix index 4dd7c796583..4a8671ab071 100644 --- a/mozilla/widget/macbuild/WidgetDebug.prefix +++ b/mozilla/widget/macbuild/WidgetDebug.prefix @@ -8,4 +8,6 @@ #include #include -#include \ No newline at end of file +#include + +#define USE_TLS_FOR_TOOLKIT 1 diff --git a/mozilla/widget/src/mac/nsAppShell.cpp b/mozilla/widget/src/mac/nsAppShell.cpp index 34621298078..251e2d21eaf 100644 --- a/mozilla/widget/src/mac/nsAppShell.cpp +++ b/mozilla/widget/src/mac/nsAppShell.cpp @@ -77,9 +77,13 @@ NS_IMETHODIMP nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListe NS_IMETHODIMP nsAppShell::Create(int* argc, char ** argv) { - mToolKit = auto_ptr( new nsToolkit() ); + nsresult rv; + rv = NS_GetCurrentToolkit(getter_AddRefs(mToolkit)); + if (NS_FAILED(rv)) + return rv; mMacSink = auto_ptr( new nsMacMessageSink() ); - mMacPump = auto_ptr( new nsMacMessagePump(mToolKit.get(), mMacSink.get()) ); + nsIToolkit* toolkit = mToolkit.get(); + mMacPump = auto_ptr( new nsMacMessagePump(static_cast(toolkit), mMacSink.get()) ); return NS_OK; } diff --git a/mozilla/widget/src/mac/nsAppShell.h b/mozilla/widget/src/mac/nsAppShell.h index 34ef88a10ef..f5284669f4e 100644 --- a/mozilla/widget/src/mac/nsAppShell.h +++ b/mozilla/widget/src/mac/nsAppShell.h @@ -33,12 +33,13 @@ #define nsAppShell_h__ #include "nsIAppShell.h" +#include "nsCOMPtr.h" #include class nsMacMessagePump; class nsMacMessageSink; -class nsToolkit; +class nsIToolkit; class nsAppShell : public nsIAppShell @@ -52,7 +53,7 @@ class nsAppShell : public nsIAppShell private: nsDispatchListener *mDispatchListener; // note: we don't own this, but it can be NULL - auto_ptr mToolKit; + nsCOMPtr mToolkit; auto_ptr mMacPump; auto_ptr mMacSink; //€€€ this will be COM, so use scc's COM_auto_ptr PRBool mExitCalled;