update for Firefox 25 / Linux

Change-Id: I3c1db0be9904a4d388c8be857bdca7b2bcc3c323
diff --git a/config.mk b/config.mk
index c299784..597cf0f 100644
--- a/config.mk
+++ b/config.mk
@@ -82,7 +82,7 @@
 # Set OS as well as CFLAGS, CXX, and other common make variables
 ifeq ($(shell uname),Linux)
 OS=linux
-BASECFLAGS= $(DEBUGCFLAGS) -O2 -fPIC $(INC) -rdynamic
+BASECFLAGS= $(DEBUGCFLAGS) -O2 -fPIC $(INC) -rdynamic -std=c++0x
 ARCHCFLAGS= -m$(FLAG32BIT)
 ALLARCHCFLAGS= -m$(FLAG32BIT)
 #CXX=clang # for better build error messages
diff --git a/xpcom/FFSessionHandler.cpp b/xpcom/FFSessionHandler.cpp
index 609b8b0..84a02d1 100755
--- a/xpcom/FFSessionHandler.cpp
+++ b/xpcom/FFSessionHandler.cpp
@@ -129,7 +129,11 @@
 }
 
 void FFSessionHandler::getToStringTearOff(JSContext* ctx) {
+#if GECKO_VERSION >= 25000
+  JS::Rooted<JS::Value> funcVal(ctx);
+# else
   jsval funcVal;
+#endif
 
   Debug::log(Debug::Debugging) << "Getting function \"__gwt_makeTearOff\""
         << Debug::flush;
@@ -180,7 +184,11 @@
   Debug::log(Debug::Debugging) << "Getting function \"__gwt_disconnected\""
         << Debug::flush;
 
+#if GECKO_VERSION >= 25000
+  JS::Rooted<JS::Value> funcVal(ctx);
+# else
   jsval funcVal;
+#endif
   if (!JS_GetProperty(ctx, global, "__gwt_disconnected", &funcVal)
       || funcVal == JSVAL_VOID) {
     Debug::log(Debug::Error) << "Could not get function \"__gwt_disconnected\""
@@ -281,7 +289,11 @@
     return true;
   }
 
+#if GECKO_VERSION >= 25000
+  JS::Rooted<JS::Value> funcVal(ctx);
+# else
   jsval funcVal;
+#endif
   // TODO: handle non-ASCII method names
   if (!JS_GetProperty(ctx, global, methodName.c_str(), &funcVal)
       || funcVal == JSVAL_VOID) {
@@ -668,7 +680,11 @@
 
 void* FFSessionHandler::identityFromObject(JSObject* obj) {
   JSContext* ctx = getJSContext();
+#if GECKO_VERSION >= 25000
+  JS::Rooted<JS::Value> rval(ctx);
+# else
   jsval rval;
+#endif
   void* returnValue = obj;
   if (JS_GetProperty(ctx, obj, "wrappedJSObject", &rval)
 #ifdef JSVAL_IS_OBJECT
diff --git a/xpcom/Makefile b/xpcom/Makefile
index b234914..91844e2 100644
--- a/xpcom/Makefile
+++ b/xpcom/Makefile
@@ -222,7 +222,16 @@
 NSPR_DLLFLAGS = -lnss3
 endif
 else
-$(error Unrecognized BROWSER of $(BROWSER) - options are ff3, ff3+, ff35, ff36, ff40, ff50, ff60, ff70, ff80, ff90, ff100, ff110, ff120, ff130, ff140, ff150, ff160, ff170, ff180, ff190, ff200, ff210)
+ifeq ($(BROWSER),ff250)
+GECKO_VERSION   = 25.0.0
+CFLAGS += -DGECKO_VERSION=25000
+GECKO_DLLFLAGS = -lxpcomglue_s
+ifeq ($(OS),mac)
+NSPR_DLLFLAGS = -lnss3
+endif
+else
+$(error Unrecognized BROWSER of $(BROWSER) - options are ff3, ff4, ff5, ...)
+endif
 endif
 endif
 endif
diff --git a/xpcom/SessionData.h b/xpcom/SessionData.h
index 3f77d42..423010d 100755
--- a/xpcom/SessionData.h
+++ b/xpcom/SessionData.h
@@ -83,9 +83,13 @@
     OBJ_TO_INNER_OBJECT(ctx, global);
 #endif
 
+#if GECKO_VERSION >= 25000
+    JSObject* global = JS::CurrentGlobalOrNull(ctx);
+#else
 #if GECKO_VERSION >= 10000
     JSObject* global = JS_GetGlobalForScopeChain(ctx);
 #endif
+#endif
 
     return global;
   }
diff --git a/xpcom/install-template.rdf b/xpcom/install-template.rdf
index 58f88a7..ce18575 100644
--- a/xpcom/install-template.rdf
+++ b/xpcom/install-template.rdf
@@ -12,7 +12,7 @@
       <Description>
         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
         <em:minVersion>3.0</em:minVersion>
-        <em:maxVersion>24.0.*</em:maxVersion>
+        <em:maxVersion>25.0.*</em:maxVersion>
       </Description>
 
     <!-- TODO: This seems to break Firefox 3.6. With this on, FF gets into a
diff --git a/xpcom/prebuilt/extension/chrome.manifest b/xpcom/prebuilt/extension/chrome.manifest
index 4d63d6e..dd24427 100644
--- a/xpcom/prebuilt/extension/chrome.manifest
+++ b/xpcom/prebuilt/extension/chrome.manifest
@@ -150,5 +150,12 @@
 binary-component lib/Darwin-gcc3/ff240/libgwt_dev_ff240.dylib ABI=Darwin_x86_64-gcc3 appversion<=24.0.*
 binary-component lib/Darwin-gcc3/ff240/libgwt_dev_ff240.dylib ABI=Darwin_x86-gcc3 appversion<=24.0.*
 
+# Firefox 25
+binary-component lib/Linux_x86_64-gcc3/ff250/libgwt_dev_ff250.so ABI=Linux_x86_64-gcc3 appversion<=25.0.*
+binary-component lib/Linux_x86-gcc3/ff250/libgwt_dev_ff250.so ABI=Linux_x86-gcc3 appversion<=25.0.*
+#binary-component lib/WINNT_x86-msvc/ff250/xpGwtDevPlugin.dll ABI=WINNT_x86-msvc appversion<=25.0.*
+#binary-component lib/Darwin-gcc3/ff250/libgwt_dev_ff250.dylib ABI=Darwin_x86_64-gcc3 appversion<=25.0.*
+#binary-component lib/Darwin-gcc3/ff250/libgwt_dev_ff250.dylib ABI=Darwin_x86-gcc3 appversion<=25.0.*
+
 interfaces components/IOOPHM.xpt
 contract @gwt.google.com/ExternalWrapper;1 {028DD88B-6D65-401D-AAFD-17E497D15D09}
diff --git a/xpcom/prebuilt/extension/lib/Linux_x86-gcc3/ff250/libgwt_dev_ff250.so b/xpcom/prebuilt/extension/lib/Linux_x86-gcc3/ff250/libgwt_dev_ff250.so
new file mode 100755
index 0000000..457d5e2
--- /dev/null
+++ b/xpcom/prebuilt/extension/lib/Linux_x86-gcc3/ff250/libgwt_dev_ff250.so
Binary files differ
diff --git a/xpcom/prebuilt/extension/lib/Linux_x86_64-gcc3/ff250/libgwt_dev_ff250.so b/xpcom/prebuilt/extension/lib/Linux_x86_64-gcc3/ff250/libgwt_dev_ff250.so
new file mode 100755
index 0000000..4c6ee6f
--- /dev/null
+++ b/xpcom/prebuilt/extension/lib/Linux_x86_64-gcc3/ff250/libgwt_dev_ff250.so
Binary files differ
diff --git a/xpcom/prebuilt/ff250/include/IOOPHM.h b/xpcom/prebuilt/ff250/include/IOOPHM.h
new file mode 100644
index 0000000..4a152ce
--- /dev/null
+++ b/xpcom/prebuilt/ff250/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 IOOPHM : public nsISupports {
+ public: 
+
+  NS_DECLARE_STATIC_IID_ACCESSOR(IOOPHM_IID)
+
+  /* boolean init (in nsIDOMWindow window); */
+  NS_IMETHOD Init(nsIDOMWindow *window, bool *_retval) = 0;
+
+  /* boolean connect (in ACString url, in ACString sessionKey, in ACString addr, in ACString moduleName, in ACString hostedHtmlVersion); */
+  NS_IMETHOD Connect(const nsACString & url, const nsACString & sessionKey, const nsACString & addr, const nsACString & moduleName, const nsACString & hostedHtmlVersion, bool *_retval) = 0;
+
+};
+
+  NS_DEFINE_STATIC_IID_ACCESSOR(IOOPHM, IOOPHM_IID)
+
+/* Use this macro when declaring classes that implement this interface. */
+#define NS_DECL_IOOPHM \
+  NS_IMETHOD Init(nsIDOMWindow *window, bool *_retval); \
+  NS_IMETHOD Connect(const nsACString & url, const nsACString & sessionKey, const nsACString & addr, const nsACString & moduleName, const nsACString & hostedHtmlVersion, bool *_retval); 
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object. */
+#define NS_FORWARD_IOOPHM(_to) \
+  NS_IMETHOD Init(nsIDOMWindow *window, bool *_retval) { return _to Init(window, _retval); } \
+  NS_IMETHOD Connect(const nsACString & url, const nsACString & sessionKey, const nsACString & addr, const nsACString & moduleName, const nsACString & hostedHtmlVersion, bool *_retval) { 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_IMETHOD Init(nsIDOMWindow *window, bool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(window, _retval); } \
+  NS_IMETHOD Connect(const nsACString & url, const nsACString & sessionKey, const nsACString & addr, const nsACString & moduleName, const nsACString & hostedHtmlVersion, bool *_retval) { 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, bool *_retval)
+{
+    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, bool *_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* End of implementation class template. */
+#endif
+
+
+#endif /* __gen_IOOPHM_h__ */
diff --git a/xpcom/prebuilt/update.rdf b/xpcom/prebuilt/update.rdf
index b3d152e..a8f45a0 100644
--- a/xpcom/prebuilt/update.rdf
+++ b/xpcom/prebuilt/update.rdf
@@ -14,7 +14,7 @@
               <Description>
                 <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                 <em:minVersion>3.0</em:minVersion>
-                <em:maxVersion>24.0.*</em:maxVersion>
+                <em:maxVersion>25.0.*</em:maxVersion>
                 <em:updateLink>https://dl-ssl.google.com/gwt/plugins/firefox/gwt-dev-plugin.xpi</em:updateLink>
                 <em:updateInfoURL>https://dl-ssl.google.com/gwt/plugins/firefox/gwt-dev-plugin-info.xhtml?locale=%APP_LOCALE%</em:updateInfoURL>