Add Firefox 3.7alpha support (still need Windows changes).

Patch by: jat
Review by: conroy

Review at http://gwt-code-reviews.appspot.com/638801


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@8276 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/plugins/xpcom/Makefile b/plugins/xpcom/Makefile
index f78f1ed..6472621 100644
--- a/plugins/xpcom/Makefile
+++ b/plugins/xpcom/Makefile
@@ -56,27 +56,34 @@
 CFLAGS += -DBROWSER=$(BROWSER)
 GECKO_MINOR_VERSION=
 ifeq ($(BROWSER),ff2)
-BROWSER_VERSION   = 1.8
-CFLAGS += -DBROWSER_FF2
+GECKO_VERSION   = 1.8
 else
 ifeq ($(BROWSER),ff3)
-BROWSER_VERSION   = 1.9.0
-CFLAGS += -DBROWSER_FF3
+GECKO_VERSION   = 1.9.0
+CFLAGS += -DGECKO_19
 else
 ifeq ($(BROWSER),ff3+)
-BROWSER_VERSION   = 1.9.0
-CFLAGS += -DBROWSER_FF3
+GECKO_VERSION   = 1.9.0
+CFLAGS += -DGECKO_19
 GECKO_MINOR_VERSION=.10
 else
 ifeq ($(BROWSER),ff35)
-BROWSER_VERSION   = 1.9.1
-CFLAGS += -DBROWSER_FF3
+GECKO_VERSION   = 1.9.1
+CFLAGS += -DGECKO_19
 else
 ifeq ($(BROWSER),ff36)
-BROWSER_VERSION   = 1.9.2
-CFLAGS += -DBROWSER_FF3
+GECKO_VERSION   = 1.9.2
+CFLAGS += -DGECKO_19
 else
-$(error Unrecognized BROWSER of $(BROWSER) - options are ff2, ff3, ff3+, ff35, ff36)
+ifeq ($(BROWSER),ff40)
+GECKO_VERSION   = 1.9.3
+CFLAGS += -DGECKO_19
+ifeq ($(OS),mac)
+DLLFLAGS += -lmozalloc
+endif
+else
+$(error Unrecognized BROWSER of $(BROWSER) - options are ff2, ff3, ff3+, ff35, ff36, ff40)
+endif
 endif
 endif
 endif
@@ -106,7 +113,7 @@
 INSTALL_RDF       = $(EXTENSION_OUTDIR)/install.rdf
 
 SDK_PATH          = $(PLUGIN_SDKS)/gecko-sdks
-GECKO_SDK         = $(SDK_PATH)/gecko-$(BROWSER_VERSION)
+GECKO_SDK         = $(SDK_PATH)/gecko-$(GECKO_VERSION)
 GECKO_PLAT_INC    = $(GECKO_SDK)/$(GECKO_PLATFORM)/include
 GECKO_LIBS        = $(GECKO_SDK)/$(GECKO_PLATFORM)/lib$(GECKO_MINOR_VERSION)
 XPIDL             = $(GECKO_SDK)/$(GECKO_PLATFORM)/bin/xpidl
@@ -156,14 +163,18 @@
 	$(MAKE) lib BROWSER=ff3+ ARCH=x86
 	$(MAKE) lib BROWSER=ff35 ARCH=x86
 	$(MAKE) lib BROWSER=ff36 ARCH=x86
+	$(MAKE) lib BROWSER=ff40 ARCH=x86
 	$(MAKE) lib BROWSER=ff3 ARCH=x86_64
 	$(MAKE) lib BROWSER=ff3+ ARCH=x86_64
 	$(MAKE) lib BROWSER=ff35 ARCH=x86_64
+	$(MAKE) lib BROWSER=ff36 ARCH=x86_64
+	$(MAKE) lib BROWSER=ff40 ARCH=x86_64
 
 macplatforms:
 	$(MAKE) lib BROWSER=ff3
 	$(MAKE) lib BROWSER=ff35
 	$(MAKE) lib BROWSER=ff36
+	$(MAKE) lib BROWSER=ff40
 
 SRCS =	\
 		ExternalWrapper.cpp \
@@ -221,6 +232,7 @@
 	@$(MAKE) $@ BROWSER=ff3+
 	@$(MAKE) $@ BROWSER=ff35
 	@$(MAKE) $@ BROWSER=ff36
+	@$(MAKE) $@ BROWSER=ff40
 endif
 
 DEPEND = g++ -MM -MT'$$(OBJ_OUTDIR)/$(patsubst %.cpp,%.o,$(src))' \
diff --git a/plugins/xpcom/ModuleOOPHM.cpp b/plugins/xpcom/ModuleOOPHM.cpp
index 4b6c98b..89aabe6 100644
--- a/plugins/xpcom/ModuleOOPHM.cpp
+++ b/plugins/xpcom/ModuleOOPHM.cpp
@@ -26,7 +26,7 @@
 #include "nsServiceManagerUtils.h"
 #include "nsXPCOMCID.h"
 
-#ifdef BROWSER_FF3
+#ifdef GECKO_19
 #include "nsIClassInfoImpl.h" // 1.9 only
 #endif
 
diff --git a/plugins/xpcom/install-template.rdf b/plugins/xpcom/install-template.rdf
index 887d48c..408926a 100644
--- a/plugins/xpcom/install-template.rdf
+++ b/plugins/xpcom/install-template.rdf
@@ -12,7 +12,7 @@
         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
         <!-- TODO: can we add 1.5-2.0 back?  Do we care? -->
         <em:minVersion>3.0</em:minVersion>
-        <em:maxVersion>3.6.*</em:maxVersion>
+        <em:maxVersion>4.0.*</em:maxVersion>
       </Description>
     </em:targetApplication>
 
diff --git a/plugins/xpcom/prebuilt/extension/components/stub.js b/plugins/xpcom/prebuilt/extension/components/stub.js
index 62b77d0..9ebb5ad 100644
--- a/plugins/xpcom/prebuilt/extension/components/stub.js
+++ b/plugins/xpcom/prebuilt/extension/components/stub.js
@@ -63,10 +63,14 @@
       return "ff36";
     }
 
-    throw "Unexpected Firefox version: " + firefoxVersion;
+    if (firefoxVersion == "3.7" || firefoxVersion == "4.0") {
+      return "ff40";
+    }
+
+    throw "Unsupported Firefox version: " + firefoxVersion;
   }
 
-  throw "Unexpected Gecko version: " + geckoVersion;
+  throw "Unsupported Gecko version: " + geckoVersion;
 }
 
 function getPlatform() {
diff --git a/plugins/xpcom/prebuilt/extension/lib/Darwin-gcc3/ff40/libgwt_dev_ff40.dylib b/plugins/xpcom/prebuilt/extension/lib/Darwin-gcc3/ff40/libgwt_dev_ff40.dylib
new file mode 100755
index 0000000..74977eb
--- /dev/null
+++ b/plugins/xpcom/prebuilt/extension/lib/Darwin-gcc3/ff40/libgwt_dev_ff40.dylib
Binary files differ
diff --git a/plugins/xpcom/prebuilt/extension/lib/Linux_x86-gcc3/ff40/libgwt_dev_ff40.so b/plugins/xpcom/prebuilt/extension/lib/Linux_x86-gcc3/ff40/libgwt_dev_ff40.so
new file mode 100755
index 0000000..a87529a
--- /dev/null
+++ b/plugins/xpcom/prebuilt/extension/lib/Linux_x86-gcc3/ff40/libgwt_dev_ff40.so
Binary files differ
diff --git a/plugins/xpcom/prebuilt/extension/lib/Linux_x86_64-gcc3/ff40/libgwt_dev_ff40.so b/plugins/xpcom/prebuilt/extension/lib/Linux_x86_64-gcc3/ff40/libgwt_dev_ff40.so
new file mode 100755
index 0000000..dbc99bd
--- /dev/null
+++ b/plugins/xpcom/prebuilt/extension/lib/Linux_x86_64-gcc3/ff40/libgwt_dev_ff40.so
Binary files differ
diff --git a/plugins/xpcom/prebuilt/ff40/include/IOOPHM.h b/plugins/xpcom/prebuilt/ff40/include/IOOPHM.h
new file mode 100644
index 0000000..0e7be5d
--- /dev/null
+++ b/plugins/xpcom/prebuilt/ff40/include/IOOPHM.h
@@ -0,0 +1,105 @@
+/*
+ * DO NOT EDIT.  THIS FILE IS GENERATED FROM IOOPHM.idl
+ */
+
+#ifndef __gen_IOOPHM_h__
+#define __gen_IOOPHM_h__
+
+
+#ifndef __gen_nsISupports_h__
+#include "nsISupports.h"
+#endif
+
+/* For IDL files that don't want to include root IDL files. */
+#ifndef NS_NO_VTABLE
+#define NS_NO_VTABLE
+#endif
+class nsIDOMWindow; /* forward declaration */
+
+
+/* starting interface:    IOOPHM */
+#define IOOPHM_IID_STR "90cef17b-c3fe-4251-af68-4381b3d938a0"
+
+#define IOOPHM_IID \
+  {0x90cef17b, 0xc3fe, 0x4251, \
+    { 0xaf, 0x68, 0x43, 0x81, 0xb3, 0xd9, 0x38, 0xa0 }}
+
+class NS_NO_VTABLE NS_SCRIPTABLE IOOPHM : public nsISupports {
+ public: 
+
+  NS_DECLARE_STATIC_IID_ACCESSOR(IOOPHM_IID)
+
+  /* boolean init (in nsIDOMWindow window); */
+  NS_SCRIPTABLE NS_IMETHOD Init(nsIDOMWindow *window, PRBool *_retval NS_OUTPARAM) = 0;
+
+  /* boolean connect (in ACString url, in ACString sessionKey, in ACString addr, in ACString moduleName, in ACString hostedHtmlVersion); */
+  NS_SCRIPTABLE NS_IMETHOD Connect(const nsACString & url, const nsACString & sessionKey, const nsACString & addr, const nsACString & moduleName, const nsACString & hostedHtmlVersion, PRBool *_retval NS_OUTPARAM) = 0;
+
+};
+
+  NS_DEFINE_STATIC_IID_ACCESSOR(IOOPHM, IOOPHM_IID)
+
+/* Use this macro when declaring classes that implement this interface. */
+#define NS_DECL_IOOPHM \
+  NS_SCRIPTABLE NS_IMETHOD Init(nsIDOMWindow *window, PRBool *_retval NS_OUTPARAM); \
+  NS_SCRIPTABLE NS_IMETHOD Connect(const nsACString & url, const nsACString & sessionKey, const nsACString & addr, const nsACString & moduleName, const nsACString & hostedHtmlVersion, PRBool *_retval NS_OUTPARAM); 
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object. */
+#define NS_FORWARD_IOOPHM(_to) \
+  NS_SCRIPTABLE NS_IMETHOD Init(nsIDOMWindow *window, PRBool *_retval NS_OUTPARAM) { return _to Init(window, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD Connect(const nsACString & url, const nsACString & sessionKey, const nsACString & addr, const nsACString & moduleName, const nsACString & hostedHtmlVersion, PRBool *_retval NS_OUTPARAM) { return _to Connect(url, sessionKey, addr, moduleName, hostedHtmlVersion, _retval); } 
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
+#define NS_FORWARD_SAFE_IOOPHM(_to) \
+  NS_SCRIPTABLE NS_IMETHOD Init(nsIDOMWindow *window, PRBool *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(window, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD Connect(const nsACString & url, const nsACString & sessionKey, const nsACString & addr, const nsACString & moduleName, const nsACString & hostedHtmlVersion, PRBool *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Connect(url, sessionKey, addr, moduleName, hostedHtmlVersion, _retval); } 
+
+#if 0
+/* Use the code below as a template for the implementation class for this interface. */
+
+/* Header file */
+class _MYCLASS_ : public IOOPHM
+{
+public:
+  NS_DECL_ISUPPORTS
+  NS_DECL_IOOPHM
+
+  _MYCLASS_();
+
+private:
+  ~_MYCLASS_();
+
+protected:
+  /* additional members */
+};
+
+/* Implementation file */
+NS_IMPL_ISUPPORTS1(_MYCLASS_, IOOPHM)
+
+_MYCLASS_::_MYCLASS_()
+{
+  /* member initializers and constructor code */
+}
+
+_MYCLASS_::~_MYCLASS_()
+{
+  /* destructor code */
+}
+
+/* boolean init (in nsIDOMWindow window); */
+NS_IMETHODIMP _MYCLASS_::Init(nsIDOMWindow *window, PRBool *_retval NS_OUTPARAM)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* boolean connect (in ACString url, in ACString sessionKey, in ACString addr, in ACString moduleName, in ACString hostedHtmlVersion); */
+NS_IMETHODIMP _MYCLASS_::Connect(const nsACString & url, const nsACString & sessionKey, const nsACString & addr, const nsACString & moduleName, const nsACString & hostedHtmlVersion, PRBool *_retval NS_OUTPARAM)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* End of implementation class template. */
+#endif
+
+
+#endif /* __gen_IOOPHM_h__ */
diff --git a/plugins/xpcom/prebuilt/gwt-dev-plugin.xpi b/plugins/xpcom/prebuilt/gwt-dev-plugin.xpi
index a1fdb7e..0baec32 100644
--- a/plugins/xpcom/prebuilt/gwt-dev-plugin.xpi
+++ b/plugins/xpcom/prebuilt/gwt-dev-plugin.xpi
Binary files differ