Bug 627498 - Call GfxInfo::Init on all platforms that implement GfxInfo. r=jrmuizel a=b
authorJoe Drew <joe@drew.ca>
Thu, 20 Jan 2011 16:27:22 -0500
changeset 61018 2736d8740c66d7359db1d175bb1b36a615bde59f
parent 61017 3b7e6d130e8e9b5cf6ed2f366864f026d89ac5f4
child 61019 3cf8c2ab8d3ba35cab0e3f846d8ec359e8a1f309
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, b
bugs627498
milestone2.0b10pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 627498 - Call GfxInfo::Init on all platforms that implement GfxInfo. r=jrmuizel a=b
widget/src/android/nsWidgetFactory.cpp
widget/src/build/nsWinWidgetFactory.cpp
widget/src/cocoa/nsWidgetFactory.mm
widget/src/xpwidgets/GfxInfoBase.h
--- a/widget/src/android/nsWidgetFactory.cpp
+++ b/widget/src/android/nsWidgetFactory.cpp
@@ -75,17 +75,18 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPr
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecAndroid)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIMEPicker)
 
 #include "GfxInfo.h"
 namespace mozilla {
 namespace widget {
-NS_GENERIC_FACTORY_CONSTRUCTOR(GfxInfo)
+// This constructor should really be shared with all platforms.
+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxInfo, Init)
 }
 }
 
 static nsresult
 nsFilePickerConstructor(nsISupports *aOuter, REFNSIID aIID,
                         void **aResult)
 {
   *aResult = nsnull;
--- a/widget/src/build/nsWinWidgetFactory.cpp
+++ b/widget/src/build/nsWinWidgetFactory.cpp
@@ -98,16 +98,17 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListB
 NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListItem)
 NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListSeparator)
 NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListLink)
 NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListShortcut)
 #endif
 
 namespace mozilla {
 namespace widget {
+// This constructor should really be shared with all platforms.
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxInfo, Init);
 }
 }
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
 #ifndef WINCE
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
--- a/widget/src/cocoa/nsWidgetFactory.mm
+++ b/widget/src/cocoa/nsWidgetFactory.mm
@@ -97,17 +97,18 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsNativeT
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacDockSupport)
 
 #include "nsStandaloneNativeMenu.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsStandaloneNativeMenu)
 
 #include "GfxInfo.h"
 namespace mozilla {
 namespace widget {
-NS_GENERIC_FACTORY_CONSTRUCTOR(GfxInfo)
+// This constructor should really be shared with all platforms.
+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxInfo, Init)
 }
 }
 
 
 NS_DEFINE_NAMED_CID(NS_WINDOW_CID);
 NS_DEFINE_NAMED_CID(NS_POPUP_CID);
 NS_DEFINE_NAMED_CID(NS_CHILD_CID);
 NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
--- a/widget/src/xpwidgets/GfxInfoBase.h
+++ b/widget/src/xpwidgets/GfxInfoBase.h
@@ -69,16 +69,19 @@ public:
   // using GfxInfoBase::GetWebGLParameter;
   // to import the relevant methods into their namespace.
   NS_SCRIPTABLE NS_IMETHOD GetFeatureStatus(PRInt32 aFeature, PRInt32 *_retval NS_OUTPARAM);
   NS_SCRIPTABLE NS_IMETHOD GetFeatureSuggestedDriverVersion(PRInt32 aFeature, nsAString & _retval NS_OUTPARAM);
   NS_SCRIPTABLE NS_IMETHOD GetWebGLParameter(const nsAString & aParam, nsAString & _retval NS_OUTPARAM);
 
   // Initialization function. If you override this, you must call this class's
   // version of Init first.
+  // We need Init to be called separately from the constructor so we can
+  // register as an observer after all derived classes have been constructed
+  // and we know we have a non-zero refcount.
   // Ideally, Init() would be void-return, but the rules of
   // NS_GENERIC_FACTORY_CONSTRUCTOR_INIT require it be nsresult return.
   virtual nsresult Init();
 
 protected:
 
   virtual nsresult GetFeatureStatusImpl(PRInt32 aFeature, PRInt32* aStatus,
                                         nsAString& aSuggestedDriverVersion,