Changes to support FF3.6 (which uses Gecko 1.9.2).  More prebuilt
libraries for various platforms will be added as they are ready.

Patch by: jat
Review by: jlabanca


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7501 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/plugins/xpcom/Makefile b/plugins/xpcom/Makefile
index 2d1966e..7c35818 100644
--- a/plugins/xpcom/Makefile
+++ b/plugins/xpcom/Makefile
@@ -49,7 +49,7 @@
 export FLAG32BIT
 
 ifeq ($(BROWSER),)
-$(warning Defaulting to FF3 build [set with BROWSER=ff2, ff3, ff3+, or ff35])
+$(warning Defaulting to FF3 build [set with BROWSER=ff2, ff3, ff3+, ff35, or ff36])
 BROWSER=ff3
 endif
 
@@ -72,7 +72,12 @@
 BROWSER_VERSION   = 1.9.1
 CFLAGS += -DBROWSER_FF3
 else
-$(error Unrecognized BROWSER of $(BROWSER) - options are ff2, ff3, ff3+, ff35)
+ifeq ($(BROWSER),ff36)
+BROWSER_VERSION   = 1.9.2
+CFLAGS += -DBROWSER_FF3
+else
+$(error Unrecognized BROWSER of $(BROWSER) - options are ff2, ff3, ff3+, ff35, ff36)
+endif
 endif
 endif
 endif
@@ -122,7 +127,7 @@
 
 INC += -I$(GECKO_PLAT_INC) -I$(GECKO_SDK)/include -I$(dir $(FF_HEADER))
 
-VERSION ?= 0.9.$(shell ./getversion).$(shell date +%Y%m%d%H%M%S)
+VERSION ?= 1.0.$(shell ./getversion).$(shell date +%Y%m%d%H%M%S)
 
 .PHONY: all xpi lib common browser clean depend install install-platform find-ff-libs
 
@@ -150,6 +155,7 @@
 	$(MAKE) lib BROWSER=ff3 ARCH=x86
 	$(MAKE) lib BROWSER=ff3+ ARCH=x86
 	$(MAKE) lib BROWSER=ff35 ARCH=x86
+	$(MAKE) lib BROWSER=ff36 ARCH=x86
 	$(MAKE) lib BROWSER=ff3 ARCH=x86_64
 	$(MAKE) lib BROWSER=ff3+ ARCH=x86_64
 	$(MAKE) lib BROWSER=ff35 ARCH=x86_64
@@ -157,6 +163,7 @@
 macplatforms:
 	$(MAKE) lib BROWSER=ff3
 	$(MAKE) lib BROWSER=ff35
+	$(MAKE) lib BROWSER=ff36
 
 SRCS =	\
 		ExternalWrapper.cpp \
@@ -213,6 +220,7 @@
 	@$(MAKE) $@ BROWSER=ff3
 	@$(MAKE) $@ BROWSER=ff3+
 	@$(MAKE) $@ BROWSER=ff35
+	@$(MAKE) $@ BROWSER=ff36
 endif
 
 DEPEND = g++ -MM -MT'$$(OBJ_OUTDIR)/$(patsubst %.cpp,%.o,$(src))' \
diff --git a/plugins/xpcom/XpcomDebug.cpp b/plugins/xpcom/XpcomDebug.cpp
index 34ef738..7eb7055 100644
--- a/plugins/xpcom/XpcomDebug.cpp
+++ b/plugins/xpcom/XpcomDebug.cpp
@@ -36,50 +36,40 @@
 
 std::string dumpJsVal(JSContext* ctx, jsval v) {
   char buf[70];
-  if (v == JSVAL_VOID) {
+  if (JSVAL_IS_VOID(v)) {
     strncpy(buf, "undef", sizeof(buf));
-  } else if (v == JSVAL_NULL) {
+  } else if (JSVAL_IS_NULL(v)) {
     strncpy(buf, "null", sizeof(buf));
-  } else {
-    switch (JSVAL_TAG(v)) {
-      case JSVAL_OBJECT:
-      {
-        JSObject* obj = JSVAL_TO_OBJECT(v);
-        if (JavaObject::isJavaObject(ctx, obj)) {
-          int oid = JavaObject::getObjectId(ctx, obj);
-          snprintf(buf, sizeof(buf), "JavaObj(%d)", oid);
-        } else {
-          JSClass* jsClass = JS_GET_CLASS(ctx, obj);
-          const char* name = jsClass->name ? jsClass->name : "<null>";
-          snprintf(buf, sizeof(buf), "Object(%.20s @ %p)", name, obj);
-        }
-        break;
-      }
-      case JSVAL_INT:
-        snprintf(buf, sizeof(buf), "int(%d)", JSVAL_TO_INT(v));
-        break;
-      case JSVAL_DOUBLE:
-        snprintf(buf, sizeof(buf), "double(%lf)", *JSVAL_TO_DOUBLE(v));
-        break;
-      case JSVAL_STRING:
-      {
-        JSString* str = JSVAL_TO_STRING(v);
-        size_t len = JS_GetStringLength(str);
-        const char* continued = "";
-        if (len > 20) {
-          len = 20;
-          continued = "...";
-        }
-        // TODO: trashes Unicode
-        snprintf(buf, sizeof(buf), "string(%.*s%s)", static_cast<int>(len),
-            JS_GetStringBytes(str), continued);
-        break;
-      }
-      case JSVAL_BOOLEAN:
-        snprintf(buf, sizeof(buf), "bool(%s)", JSVAL_TO_BOOLEAN(v) ? "true"
-            : " false");
-        break;
+  } else if (JSVAL_IS_OBJECT(v)) {
+    JSObject* obj = JSVAL_TO_OBJECT(v);
+    if (JavaObject::isJavaObject(ctx, obj)) {
+      int oid = JavaObject::getObjectId(ctx, obj);
+      snprintf(buf, sizeof(buf), "JavaObj(%d)", oid);
+    } else {
+      JSClass* jsClass = JS_GET_CLASS(ctx, obj);
+      const char* name = jsClass->name ? jsClass->name : "<null>";
+      snprintf(buf, sizeof(buf), "Object(%.20s @ %p)", name, obj);
     }
+  } else if (JSVAL_IS_INT(v)) {
+    snprintf(buf, sizeof(buf), "int(%d)", JSVAL_TO_INT(v));
+  } else if (JSVAL_IS_DOUBLE(v)) {
+    snprintf(buf, sizeof(buf), "double(%lf)", *JSVAL_TO_DOUBLE(v));
+  } else if (JSVAL_IS_STRING(v)) {
+    JSString* str = JSVAL_TO_STRING(v);
+    size_t len = JS_GetStringLength(str);
+    const char* continued = "";
+    if (len > 20) {
+      len = 20;
+      continued = "...";
+    }
+    // TODO: trashes Unicode
+    snprintf(buf, sizeof(buf), "string(%.*s%s)", static_cast<int>(len),
+        JS_GetStringBytes(str), continued);
+  } else if (JSVAL_IS_BOOLEAN(v)) {
+    snprintf(buf, sizeof(buf), "bool(%s)", JSVAL_TO_BOOLEAN(v) ? "true"
+        : " false");
+  } else {
+    snprintf(buf, sizeof(buf), "unknown(%08x)", v);
   }
   buf[sizeof(buf) - 1] = 0;
   return std::string(buf);
diff --git a/plugins/xpcom/install-template.rdf b/plugins/xpcom/install-template.rdf
index 493f9ec..887d48c 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.5.*</em:maxVersion>
+        <em:maxVersion>3.6.*</em:maxVersion>
       </Description>
     </em:targetApplication>
 
diff --git a/plugins/xpcom/prebuilt/extension/components/stub.js b/plugins/xpcom/prebuilt/extension/components/stub.js
index b7267ca..62b77d0 100644
--- a/plugins/xpcom/prebuilt/extension/components/stub.js
+++ b/plugins/xpcom/prebuilt/extension/components/stub.js
@@ -59,6 +59,10 @@
       return "ff35";
     }
 
+    if (firefoxVersion == "3.6") {
+      return "ff36";
+    }
+
     throw "Unexpected Firefox version: " + firefoxVersion;
   }
 
diff --git a/plugins/xpcom/prebuilt/extension/lib/Linux_x86-gcc3/ff36/libgwt_dev_ff36.so b/plugins/xpcom/prebuilt/extension/lib/Linux_x86-gcc3/ff36/libgwt_dev_ff36.so
new file mode 100755
index 0000000..7b611ea
--- /dev/null
+++ b/plugins/xpcom/prebuilt/extension/lib/Linux_x86-gcc3/ff36/libgwt_dev_ff36.so
Binary files differ
diff --git a/plugins/xpcom/prebuilt/ff36/include/IOOPHM.h b/plugins/xpcom/prebuilt/ff36/include/IOOPHM.h
new file mode 100644
index 0000000..0e7be5d
--- /dev/null
+++ b/plugins/xpcom/prebuilt/ff36/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__ */