[Jpackage-commits] dist/gwt/devel Mozilla.java, 1.1, 1.2 WebappClassLoader.java, 1.1, 1.2 gwt-benchmarkViewer, 1.1, 1.2 gwt-mozilla-64.patch, NONE, 1.1 gwt-mozilla-google.patch, NONE, 1.1 gwt-mozilla.patch, 1.1, 1.2 gwt-tomcat-google.patch, NONE, 1.1 gwt.spec, 1.2, 1.3

David Walluck david at ryu.zarb.org
Fri Feb 27 00:03:26 CET 2009


Update of /home/projects/jpackage/cvs/dist/gwt/devel
In directory ryu.zarb.org:/tmp/cvs-serv11680

Modified Files:
	Mozilla.java WebappClassLoader.java gwt-benchmarkViewer 
	gwt-mozilla.patch gwt.spec 
Added Files:
	gwt-mozilla-64.patch gwt-mozilla-google.patch 
	gwt-tomcat-google.patch 
Log Message:
- build fixes

Index: WebappClassLoader.java
===================================================================
RCS file: /home/projects/jpackage/cvs/dist/gwt/devel/WebappClassLoader.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** WebappClassLoader.java	25 Feb 2009 21:20:49 -0000	1.1
--- WebappClassLoader.java	26 Feb 2009 23:03:23 -0000	1.2
***************
*** 1299,1307 ****
          // (0.2) Try loading the class with the system class loader, to prevent
          //       the webapp from overriding J2SE classes
-         // GOOGLE: use the bootstrap loader, not the system loader; it breaks
-         //       embedding.
          try {
!            // clazz = system.loadClass(name);
!             clazz = Class.forName(name, false, null);
              if (clazz != null) {
                  if (resolve)
--- 1299,1304 ----
          // (0.2) Try loading the class with the system class loader, to prevent
          //       the webapp from overriding J2SE classes
          try {
!             clazz = system.loadClass(name);
              if (clazz != null) {
                  if (resolve)

Index: gwt-benchmarkViewer
===================================================================
RCS file: /home/projects/jpackage/cvs/dist/gwt/devel/gwt-benchmarkViewer,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** gwt-benchmarkViewer	25 Feb 2009 21:20:49 -0000	1.1
--- gwt-benchmarkViewer	26 Feb 2009 23:03:24 -0000	1.2
***************
*** 30,33 ****
  
  # Let's start
! export LD_LIBRARY_PATH=/usr/lib64/xulrunner-1.9:/usr/lib64/eclipse:/usr/lib64/gwt
  run -port auto com.google.gwt.benchmarks.viewer.ReportViewer/ReportViewer.html?gwt.hybrid
--- 30,33 ----
  
  # Let's start
! export LD_LIBRARY_PATH=@XULRUNNER_PATH@:@LIBDIR@/eclipse:@LIBDIR@/@NAME@
  run -port auto com.google.gwt.benchmarks.viewer.ReportViewer/ReportViewer.html?gwt.hybrid

--- NEW FILE: gwt-tomcat-google.patch ---
--- gwt-1.6.0/dev/core/src/org/apache/catalina/loader/WebappClassLoader.java.orig	2009-02-26 17:14:53.240235988 -0500
+++ gwt-1.6.0/dev/core/src/org/apache/catalina/loader/WebappClassLoader.java	2009-02-25 16:20:49.000000000 -0500
@@ -1298,8 +1298,11 @@
 
         // (0.2) Try loading the class with the system class loader, to prevent
         //       the webapp from overriding J2SE classes
+        // GOOGLE: use the bootstrap loader, not the system loader; it breaks
+        //       embedding.
         try {
-            clazz = system.loadClass(name);
+           // clazz = system.loadClass(name);
+            clazz = Class.forName(name, false, null);
             if (clazz != null) {
                 if (resolve)
                     resolveClass(clazz);

Index: gwt-mozilla.patch
===================================================================
RCS file: /home/projects/jpackage/cvs/dist/gwt/devel/gwt-mozilla.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** gwt-mozilla.patch	25 Feb 2009 21:20:49 -0000	1.1
--- gwt-mozilla.patch	26 Feb 2009 23:03:24 -0000	1.2
***************
*** 1,338 ****
- --- gwt-1.6.0/dev/linux/src/com/google/gwt/dev/shell/moz/BrowserWidgetMoz.java.orig	2009-02-22 15:23:39.624360965 -0500
- +++ gwt-1.6.0/dev/linux/src/com/google/gwt/dev/shell/moz/BrowserWidgetMoz.java	2009-02-22 15:23:54.319361916 -0500
- @@ -119,7 +119,7 @@
-        public boolean matchesDOMWindow(int domWindow) {
-          nsIWebBrowser webBrowser = (nsIWebBrowser) LowLevel.snatchFieldObjectValue(
-              browser.getClass(), browser, "webBrowser");
- -        int[] aContentDOMWindow = new int[1];
- +        long[] aContentDOMWindow = new long[1];
-          webBrowser.GetContentDOMWindow(aContentDOMWindow);
-          if (aContentDOMWindow[0] == domWindow) {
-            return true;
- --- gwt-1.6.0/jni/linux.orig/ExternalWrapper.cpp	2008-12-10 19:39:41.000000000 -0500
- +++ gwt-1.6.0/jni/linux/ExternalWrapper.cpp	2009-02-22 18:03:37.897236741 -0500
- @@ -47,7 +47,7 @@
-      jsval *argv, jsval *rval)
-  {
-    Tracer tracer("gwtOnLoad");
- -  tracer.log("context=%08x", unsigned(cx));
- +  tracer.log("context=%08x", long(cx));
-    JsRootedValue::ContextManager context(cx);
-    JsRootedValue::ensureRuntime(cx);
-    if (argc < 3) {
- @@ -125,10 +125,10 @@
-      return JS_FALSE;
-    }
-  
- -  tracer.log("scriptGlobal=%08x", unsigned(scriptGlobal.get()));
- +  tracer.log("scriptGlobal=%08x", long(scriptGlobal.get()));
-  
-    jboolean result = savedJNIEnv->CallBooleanMethod(externalObject, methodID,
- -      NS_REINTERPRET_CAST(jint, scriptGlobal.get()), jModuleName, jVersion);
- +      NS_REINTERPRET_CAST(jlong, scriptGlobal.get()), jModuleName, jVersion);
-    if (savedJNIEnv->ExceptionCheck()) {
-      tracer.setFail("LowLevelMoz.ExternalObject.gwtOnLoad() threw an exception");
-      return JS_FALSE;
- @@ -145,7 +145,7 @@
-      jsval *argv, jsval *rval)
-  {
-    Tracer tracer("initModule");
- -  tracer.log("context=%08x", unsigned(cx));
- +  tracer.log("context=%08x", long(cx));
-    JsRootedValue::ContextManager context(cx);
-    JsRootedValue::ensureRuntime(cx);
-    if (argc < 1) {
- @@ -318,7 +318,7 @@
-        return NS_ERROR_UNEXPECTED;
-      }
-  
- -    tracer.log("savedJNIEnv=%08x, llClass=%08x", unsigned(savedJNIEnv),
- +    tracer.log("savedJNIEnv=%08x, llClass=%08x", long(savedJNIEnv),
-          lowLevelMozClass);
-      
-      jmethodID methodID = savedJNIEnv->GetStaticMethodID(lowLevelMozClass,
- @@ -330,7 +330,7 @@
-      }
-  
-      jobject externalObject = savedJNIEnv->CallStaticObjectMethod(
- -        lowLevelMozClass, methodID, NS_REINTERPRET_CAST(jint, topWindow.get()));
- +        lowLevelMozClass, methodID, NS_REINTERPRET_CAST(jlong, topWindow.get()));
-      if (!externalObject || savedJNIEnv->ExceptionCheck()) {
-        tracer.setFail("createExternalObjectForDOMWindow failed");
-        return NS_ERROR_UNEXPECTED;
- --- gwt-1.6.0/jni/linux.orig/JsRootedValue.cpp	2007-07-25 16:51:13.000000000 -0400
- +++ gwt-1.6.0/jni/linux/JsRootedValue.cpp	2009-02-22 18:04:50.576234899 -0500
- @@ -40,5 +40,5 @@
-      return;
-    }
-    stringClass = JS_GET_CLASS(cx, obj);
- -  tracer.log("stringClass=%08x", unsigned(stringClass));
- +  tracer.log("stringClass=%08x", long(stringClass));
-  }
- --- gwt-1.6.0/jni/linux.orig/JsRootedValue.h	2007-07-25 16:51:13.000000000 -0400
- +++ gwt-1.6.0/jni/linux/JsRootedValue.h	2009-02-22 17:58:31.785285284 -0500
- @@ -85,7 +85,7 @@
-     */
-    static void pushContext(JSContext* context) {
-      Tracer tracer("JsRootedValue::pushContext");
- -    tracer.log("pushed context=%08x", unsigned(context));
- +    tracer.log("pushed context=%08x", long(context));
-      contextStack.push(context);
-    }
-    
- @@ -96,7 +96,7 @@
-      Tracer tracer("JsRootedValue::popContext");
-      JSContext* context = currentContext();
-      contextStack.pop();
- -    tracer.log("popped context=%08x", unsigned(context));
- +    tracer.log("popped context=%08x", long(context));
-    }
-  
-  public:
- @@ -184,7 +184,7 @@
-        ::abort();
-      }
-      JSContext* context = contextStack.top();
- -    tracer.log("context=%08x", unsigned(context));
- +    tracer.log("context=%08x", long(context));
-      return context;
-    }
-  
- --- gwt-1.6.0/jni/linux.orig/JsValueMoz.cpp	2008-03-28 20:50:28.000000000 -0400
- +++ gwt-1.6.0/jni/linux/JsValueMoz.cpp	2009-02-22 18:02:51.770361675 -0500
- @@ -47,7 +47,7 @@
-  
-    JsRootedValue* jsRootedValue = new JsRootedValue();
-    savedJNIEnv->CallVoidMethod(obj, getFieldMeth, fieldName,
- -  	 reinterpret_cast<jint>(jsRootedValue));
- +  	 reinterpret_cast<jlong>(jsRootedValue));
-    if (savedJNIEnv->ExceptionCheck()) {
-    	 delete jsRootedValue;
-      return 0;
- @@ -78,7 +78,7 @@
-    }
-  
-    savedJNIEnv->CallVoidMethod(obj, getFieldMeth, fieldName,
- -  	 reinterpret_cast<jint>(jsRootedValue));
- +  	 reinterpret_cast<jlong>(jsRootedValue));
-    if (savedJNIEnv->ExceptionCheck()) {
-      return false;
-    }
- @@ -216,7 +216,7 @@
-    
-    // argv[-1] is OBJECT_TO_JSVAL(this)
-    JsRootedValue* jsThis = new JsRootedValue(argv[-1]);
- -  tracer.log("jsthis=%08x, RV=%08x", unsigned(argv[-1]), unsigned(jsThis));
- +  tracer.log("jsthis=%08x, RV=%08x", long(argv[-1]), long(jsThis));
-  
-    // create JsRootedValues for arguments  
-    JsRootedValue *jsArgs[argc]; 
- @@ -244,13 +244,13 @@
-    // roots the JS interpreter has to search.
-    
-    // call Java method
- -  savedJNIEnv->CallVoidMethod(dispMeth, invokeID, reinterpret_cast<int>(jsThis),
- -      args, reinterpret_cast<int>(jsReturnVal));
- +  savedJNIEnv->CallVoidMethod(dispMeth, invokeID, reinterpret_cast<long>(jsThis),
- +      args, reinterpret_cast<long>(jsReturnVal));
-    
-    JSBool returnValue = JS_TRUE;
-    
-    if (savedJNIEnv->ExceptionCheck()) {
- -    tracer.log("dispMeth=%08x", unsigned(dispMeth));
- +    tracer.log("dispMeth=%08x", long(dispMeth));
-      tracer.setFail("java exception is active:");
-      jobject exception = savedJNIEnv->ExceptionOccurred();
-      if (exception) {
- @@ -293,7 +293,7 @@
-  {
-    Tracer tracer("JsValueMoz._createJsRootedValue");
-    JsRootedValue* jsRootedValue = new JsRootedValue(jsval);
- -  return NS_REINTERPRET_CAST(jint, jsRootedValue);
- +  return NS_REINTERPRET_CAST(jlong, jsRootedValue);
-  }
-  
-  /*
- @@ -309,7 +309,7 @@
-        (jsRootedValueInt);
-    Tracer tracer("JsValueMoz._copyJsRootedValue", jsRootedValue);
-    JsRootedValue* newRootedValue = new JsRootedValue(*jsRootedValue);
- -  return NS_REINTERPRET_CAST(jint, newRootedValue);
- +  return NS_REINTERPRET_CAST(jlong, newRootedValue);
-  }
-  
-  /*
- @@ -537,7 +537,7 @@
-      JSObject* jsObject = JSVAL_TO_OBJECT(val);
-      returnValue = !JS_InstanceOf(JsRootedValue::currentContext(), jsObject,
-          &gwt_nativewrapper_class, 0);
- -    tracer.log("jsobject=%08x, isJSObject=%s", unsigned(jsObject),
- +    tracer.log("jsobject=%08x, isJSObject=%s", long(jsObject),
-          returnValue ? "true" : "false");
-    } else {
-      tracer.log("not an object");
- @@ -648,7 +648,7 @@
-      JSObject* jsObject = JSVAL_TO_OBJECT(val);
-      returnValue = JS_InstanceOf(JsRootedValue::currentContext(), jsObject,
-          &gwt_nativewrapper_class, 0);
- -    tracer.log("jsobject=%08x, wrappedJava=%s", unsigned(jsObject),
- +    tracer.log("jsobject=%08x, wrappedJava=%s", long(jsObject),
-          returnValue ? "true" : "false");
-    } else {
-      tracer.log("not an object");
- @@ -835,7 +835,7 @@
-    }
-    // Save in output value so it won't get GCed.
-    jsRootedValue->setObject(newObj); 
- -  tracer.log("jsobject=%08x", unsigned(newObj));
- +  tracer.log("jsobject=%08x", long(newObj));
-    
-    // This is collected when the gwt_nativewrapper_class destructor runs.
-    jobject dispObjRef = jniEnv->NewGlobalRef(obj);
- @@ -871,7 +871,7 @@
-    // allocate a new root to hold the result of the getField call
-    JsRootedValue* toStringFunc = new JsRootedValue(); 
-    jniEnv->CallVoidMethod(obj, getFieldMeth, ident,
- -      NS_REINTERPRET_CAST(jint, toStringFunc));
- +      NS_REINTERPRET_CAST(jlong, toStringFunc));
-    if (toStringFunc->isUndefined() || jniEnv->ExceptionCheck()) {
-      tracer.throwHostedModeException(jniEnv, "getField(toString) failed");
-      return;
- @@ -907,7 +907,7 @@
-      return;
-    }
-    tracer.log("JsRootedValue=%08x, method=%s, obj=%08x", jsRootedValueInt,
- -      nameStr.str(), unsigned(dispatchMethod));
- +      nameStr.str(), long(dispatchMethod));
-    JSFunction* function = JS_NewFunction(cx, invokeJavaMethod, 0,
-        JSFUN_LAMBDA, 0, nameStr.str());
-    if (!function) {
- @@ -929,8 +929,8 @@
-      tracer.throwHostedModeException(jniEnv, "JS_NewObject failed");
-      return;
-    }
- -  tracer.log("funObj=%08x, cleanupObj=%08x", unsigned(funObj),
- -      unsigned(cleanupObj));
- +  tracer.log("funObj=%08x, cleanupObj=%08x", long(funObj),
- +        long(cleanupObj));
-    // Store the cleanup object in funObj's reserved slot; now GC protected.
-    if(!JS_SetReservedSlot(cx, funObj, 0, OBJECT_TO_JSVAL(cleanupObj))) {
-      tracer.throwHostedModeException(jniEnv, "JS_SetReservedSlot failed");
- --- gwt-1.6.0/jni/linux.orig/Makefile	2008-03-04 20:14:12.000000000 -0500
- +++ gwt-1.6.0/jni/linux/Makefile	2009-02-22 18:24:35.194318624 -0500
- @@ -16,7 +16,7 @@
-  # Target settings
-  ##
-  #JAVA_HOME
- -#JAVA_HOME=/usr/lib/j2sdk1.5-sun
- +JAVA_HOME ?= /usr/lib/jvm/java
-  
-  # set GWT_TOOLS only if it is not already defined
-  GWT_TOOLS ?= ../../../tools
- @@ -55,33 +55,34 @@
-  OBJS    := $(addprefix $(OBJDIR),$(SRCS:.cpp=.o))
-  DEPS    := $(addprefix $(OBJDIR),$(SRCS:.cpp=.d))
-  
- -MOZDIR = $(GWT_TOOLS)/sdk/mozilla-1.7.12
- -MOZINC = $(MOZDIR)/include
- -MOZLIB = $(MOZDIR)/lib
- +#MOZDIR = $(GWT_TOOLS)/sdk/mozilla-1.7.12
- +#MOZINC = $(MOZDIR)/include
- +#MOZLIB = $(MOZDIR)/lib
-  
-  ##
-  # Include path configuration
-  ##
-  SYSINCS := \
-      $(JAVA_HOME)/include \
- -    $(JAVA_HOME)/include/linux \
- -    $(MOZINC) $(MOZINC)/extra
- +    $(JAVA_HOME)/include/linux
-  
- -INCS := $(OBJDIR)
- -INCS := $(addprefix -I ,$(INCS)) $(addprefix -isystem ,$(SYSINCS))
- +#INCS := $(OBJDIR)
- +#INCS := $(addprefix -I ,$(INCS)) $(addprefix -isystem ,$(SYSINCS))
-  
-  ##
-  # Libraries and library path
-  ##
- -LIBS    = xpcomglue_s
- -LIBPATH = -L$(MOZLIB)
- -LIBS     := $(addprefix -l,$(LIBS))
- +#LIBS    = xpcomglue_s
- +#LIBPATH = -L$(MOZLIB)
- +#LIBS     := $(addprefix -l,$(LIBS))
-  
-  # for notes on auto-dependency generation, see
-  #   http://make.paulandlesley.org/autodep.html
-  # -MP obviates the need for sed hackery
- -CFLAGS   := -ggdb -m32 -Os -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -D_REENTRANT -MMD -MP -Wno-system-headers $(CFLAGS)
- -LDFLAGS  := -ggdb -m32 -s -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -D_REENTRANT -Wl,-shared-gcc $(LDFLAGS)
- +#CFLAGS   := -ggdb -Os -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -D_REENTRANT -MMD -MP -Wno-system-headers $(CFLAGS)
- +#LDFLAGS  := -ggdb -s -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -D_REENTRANT -Wl,-shared-gcc $(LDFLAGS)
- +CFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -I$(OBJDIR)  -fPIC `pkg-config --cflags libxul-unstable` -DMOZILLA_INTERNAL_API
- +LDFLAGS =  `pkg-config --libs libxul-unstable`
-  
-  #-------------------------------------------------------------------------------
-  # Rules
- @@ -134,7 +135,7 @@
-  ##
-  # Actual output file
-  ##
- -$(OUT): $(OBJS) $(MOZLIB)/libxpcomglue_s.a
- +$(OUT): $(OBJS)
-  	@[ -d $(OUTDIR) ] || mkdir -p $(OUTDIR)
-  	$(LD) -shared $(LDFLAGS) $(LIBPATH) -o $@ $^ $(LIBS)
-  	$(STRIP) --strip-unneeded $@
- --- gwt-1.6.0/jni/linux.orig/NativeWrapper.cpp	2008-06-10 21:12:18.000000000 -0400
- +++ gwt-1.6.0/jni/linux/NativeWrapper.cpp	2009-02-22 18:04:24.399235658 -0500
- @@ -89,7 +89,7 @@
-  
-    JsRootedValue* jsRootedValue = new JsRootedValue();
-    savedJNIEnv->CallVoidMethod(obj, getFieldMeth, fieldName,
- -    reinterpret_cast<jint>(jsRootedValue));
- +    reinterpret_cast<jlong>(jsRootedValue));
-    if (savedJNIEnv->ExceptionCheck()) {
-      delete jsRootedValue;
-      return 0;
- @@ -120,7 +120,7 @@
-    }
-  
-    savedJNIEnv->CallVoidMethod(obj, getFieldMeth, fieldName,
- -    reinterpret_cast<jint>(jsRootedValue));
- +    reinterpret_cast<jlong>(jsRootedValue));
-    if (savedJNIEnv->ExceptionCheck()) {
-      return false;
-    }
- @@ -132,7 +132,7 @@
-      JSObject *obj, jsval id, jsval *vp)
-  {
-    Tracer tracer("gwt_nativewrapper_getProperty");
- -  tracer.log("context=%08x, obj=%08x", unsigned(cx), unsigned(obj));
- +  tracer.log("context=%08x, obj=%08x", long(cx), long(obj));
-    JsRootedValue::ContextManager context(cx);
-  
-    jclass dispClass;
- @@ -177,7 +177,7 @@
-  static JSBool JS_DLL_CALLBACK gwt_nativewrapper_setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
-  {
-    Tracer tracer("gwt_nativewrapper_setProperty");
- -  tracer.log("context=%08x", unsigned(cx));
- +  tracer.log("context=%08x", long(cx));
-    JsRootedValue::ContextManager context(cx);
-    jclass dispClass;
-    jobject dispObj;
- --- gwt-1.6.0/jni/core/gwt-ll.cpp.orig	2009-02-22 18:51:02.872240155 -0500
- +++ gwt-1.6.0/jni/core/gwt-ll.cpp	2009-02-22 18:51:15.378366073 -0500
- @@ -14,7 +14,7 @@
-   * Signature: (Ljava/lang/Object;)I
-   */
-  JNIEXPORT jint JNICALL Java_com_google_gwt_dev_shell_LowLevel__1newGlobalRefInt(JNIEnv* env, jclass, jobject o) {
- -	return reinterpret_cast<int>(env->NewGlobalRef(o));
- +	return reinterpret_cast<long>(env->NewGlobalRef(o));
-  }
-  /*
-   * Class:     com_google_gwt_dev_shell_LowLevel
  --- gwt-1.6.0/dev/core/src/com/google/gwt/dev/shell/LowLevel.java.orig	2009-02-23 17:17:49.208362054 -0500
  +++ gwt-1.6.0/dev/core/src/com/google/gwt/dev/shell/LowLevel.java	2009-02-23 17:18:14.904237241 -0500
--- 1,2 ----
***************
*** 388,462 ****
             if (mozInstall.isAcceptable()) {
  --- gwt-1.6.0/jni/linux/mozilla-headers.h.mozilla	2007-05-23 14:45:55.000000000 -0400
! +++ gwt-1.6.0/jni/linux/mozilla-headers.h	2009-02-24 20:42:39.790237046 -0500
! @@ -16,7 +16,7 @@
   
   // include all of the necessary Mozilla headers.
!  #include "mozilla-config.h"
  -#include "nsIServiceManagerUtils.h"
! +#include "nsIServiceManager.h"
!  #include "nsComponentManagerUtils.h"
   #include "nsICategoryManager.h"
   #include "nsIScriptNameSpaceManager.h"
! @@ -26,5 +26,13 @@
!  #include "nsIDOMWindow.h"
   #include "nsIXPConnect.h"
!  #include "nsIFactory.h"
  -#include "nsCOMPtr.h"
! +//#include "nsCOMPtr.h"
!  #include "nsAutoPtr.h"
! +#include "jsapi.h"
! +#include "nsDOMJSUtils.h"
! +#include "nsIComponentManager.h"
! +#include "nsIComponentRegistrar.h"
! +#include "nsXPCOM.h"
  +#define NS_REINTERPRET_CAST(a, b) reinterpret_cast<a>(b)
- +#include "nsError.h"
- +#define NS_FAILED(_nsresult) (NS_UNLIKELY((_nsresult) & 0x80000000))
  --- gwt-1.6.0/jni/linux/LowLevelMoz.cpp.mozilla	2008-06-10 21:12:18.000000000 -0400
! +++ gwt-1.6.0/jni/linux/LowLevelMoz.cpp	2009-02-25 10:12:40.458236738 -0500
! @@ -225,16 +225,19 @@
!        NS_REINTERPRET_CAST(nsIScriptGlobalObject*, scriptObjectInt);
!    JSObject* scriptWindow =
!        reinterpret_cast<JSObject*>(scriptObject->GetGlobalJSObject());
! -  nsXPIDLString scriptString;
! +  nsXPIDLString scriptString;
!    scriptString = jcode.jstr();
!  
     nsXPIDLString aRetValue;
     PRBool aIsUndefined;
! -  if (NS_FAILED(scriptContext->EvaluateString(scriptString, scriptWindow, 0,
  -      jfile.str(), line, 0, aRetValue, &aIsUndefined))) {
! +//nsDerivedSafe<nsIScriptContext>::EvaluateString(nsXPIDLString&, JSObject*&, int, const char*, jint&, int, nsXPIDLString&, PRBool*)
! +//nsIScriptContext::EvaluateString(const nsAString_internal&, void*, nsIPrincipal*, const char*, PRUint32, PRUint32, nsAString_internal*, PRBool*)
! +/*
! +  if (NS_FAILED(scriptContext->EvaluateString(scriptString, (void*) scriptWindow, (nsIPrincipal*) 0,
! +      (const char*) jfile.str(), (PRUint32) line, (PRUint32) 0, aRetValue, (PRBool*) &aIsUndefined))) {
       tracer.setFail("EvaluateString failed");
       return JNI_FALSE;
! -  }
! +  }*/
!    return JNI_TRUE;
!  }
!  
! @@ -350,16 +353,17 @@
!    Tracer tracer("LowLevelMoz._registerExternalFactoryHandler");
!  
     char buf[256];
! -  sprintf(buf, " jniEnv=%08x, llClass=%08x", (unsigned)env, (unsigned)llClass);
! +  sprintf(buf, " jniEnv=%08x, llClass=%08x", (long)env, (long)llClass);
     tracer.log(buf);
  -  
! +  long *result = new long[1];
  +
     // Register "window.external" as our own class
  -  if (NS_FAILED(nsComponentManager::RegisterFactory(
! +  /*if (NS_FAILED(nsIComponentRegistrar::RegisterFactory(
         kGwtExternalCID, "externalFactory", GWT_EXTERNAL_CONTRACTID,
!        new nsRpExternalFactory(), PR_TRUE))) {
       tracer.setFail("RegisterFactory failed");
       return JNI_FALSE;
! -  }
! +  }*/
   
!    nsCOMPtr<nsICategoryManager> categoryManager =
!        do_GetService(NS_CATEGORYMANAGER_CONTRACTID);
--- 52,152 ----
             if (mozInstall.isAcceptable()) {
  --- gwt-1.6.0/jni/linux/mozilla-headers.h.mozilla	2007-05-23 14:45:55.000000000 -0400
! +++ gwt-1.6.0/jni/linux/mozilla-headers.h	2009-02-26 10:54:29.117236024 -0500
! @@ -15,16 +15,18 @@
!   */
   
   // include all of the necessary Mozilla headers.
! -#include "mozilla-config.h"
  -#include "nsIServiceManagerUtils.h"
! -#include "nsComponentManagerUtils.h"
! +
! +#include "xpcom-config.h"
! +
! +#include "nsAutoPtr.h"
! +#include "nsDOMJSUtils.h"
   #include "nsICategoryManager.h"
+ +#include "nsIComponentRegistrar.h"
+ +#include "nsIDOMWindow.h"
+ +#include "nsIScriptGlobalObject.h"
   #include "nsIScriptNameSpaceManager.h"
!  #include "nsIScriptObjectOwner.h"
! -#include "nsIScriptGlobalObject.h"
! -#include "nsIScriptContext.h"
! -#include "nsIDOMWindow.h"
! +#include "nsIServiceManager.h"
   #include "nsIXPConnect.h"
! -#include "nsIFactory.h"
  -#include "nsCOMPtr.h"
! -#include "nsAutoPtr.h"
! +
  +#define NS_REINTERPRET_CAST(a, b) reinterpret_cast<a>(b)
  --- gwt-1.6.0/jni/linux/LowLevelMoz.cpp.mozilla	2008-06-10 21:12:18.000000000 -0400
! +++ gwt-1.6.0/jni/linux/LowLevelMoz.cpp	2009-02-26 13:44:28.212236357 -0500
! @@ -231,7 +231,7 @@
     nsXPIDLString aRetValue;
     PRBool aIsUndefined;
!    if (NS_FAILED(scriptContext->EvaluateString(scriptString, scriptWindow, 0,
  -      jfile.str(), line, 0, aRetValue, &aIsUndefined))) {
! +      jfile.str(), line, 0, &aRetValue, &aIsUndefined))) {
       tracer.setFail("EvaluateString failed");
       return JNI_FALSE;
!    }
! @@ -352,11 +352,14 @@
     char buf[256];
!    sprintf(buf, " jniEnv=%08x, llClass=%08x", (unsigned)env, (unsigned)llClass);
     tracer.log(buf);
  -  
! +  int *result = new int[1];
! +  nsCOMPtr<nsIComponentRegistrar> registrar;
! +  NS_GetComponentRegistrar(getter_AddRefs(registrar));
  +
     // Register "window.external" as our own class
  -  if (NS_FAILED(nsComponentManager::RegisterFactory(
! +  if (!registrar || NS_FAILED(registrar->RegisterFactory(
         kGwtExternalCID, "externalFactory", GWT_EXTERNAL_CONTRACTID,
! -      new nsRpExternalFactory(), PR_TRUE))) {
! +      new nsRpExternalFactory()))) {
       tracer.setFail("RegisterFactory failed");
       return JNI_FALSE;
!    }
! --- gwt-1.6.0/jni/linux/Makefile.mozilla	2008-03-04 20:14:12.000000000 -0500
! +++ gwt-1.6.0/jni/linux/Makefile	2009-02-26 17:34:19.473236962 -0500
! @@ -16,7 +16,7 @@
!  # Target settings
!  ##
!  #JAVA_HOME
! -#JAVA_HOME=/usr/lib/j2sdk1.5-sun
! +JAVA_HOME ?= /usr/lib/jvm/java
   
!  # set GWT_TOOLS only if it is not already defined
!  GWT_TOOLS ?= ../../../tools
! @@ -55,7 +55,7 @@
!  OBJS    := $(addprefix $(OBJDIR),$(SRCS:.cpp=.o))
!  DEPS    := $(addprefix $(OBJDIR),$(SRCS:.cpp=.d))
!  
! -MOZDIR = $(GWT_TOOLS)/sdk/mozilla-1.7.12
! +MOZDIR = @XULRUNNER_SDKDIR@/sdk
!  MOZINC = $(MOZDIR)/include
!  MOZLIB = $(MOZDIR)/lib
!  
! @@ -64,8 +64,7 @@
!  ##
!  SYSINCS := \
!      $(JAVA_HOME)/include \
! -    $(JAVA_HOME)/include/linux \
! -    $(MOZINC) $(MOZINC)/extra
! +    $(JAVA_HOME)/include/linux
!  
!  INCS := $(OBJDIR)
!  INCS := $(addprefix -I ,$(INCS)) $(addprefix -isystem ,$(SYSINCS))
! @@ -80,8 +79,8 @@
!  # for notes on auto-dependency generation, see
!  #   http://make.paulandlesley.org/autodep.html
!  # -MP obviates the need for sed hackery
! -CFLAGS   := -ggdb -m32 -Os -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -D_REENTRANT -MMD -MP -Wno-system-headers $(CFLAGS)
! -LDFLAGS  := -ggdb -m32 -s -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -D_REENTRANT -Wl,-shared-gcc $(LDFLAGS)
! +CFLAGS   := -ggdb -Os -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -D_REENTRANT -MMD -MP -Wno-system-headers $(CFLAGS) `pkg-config --cflags libxul-unstable` -DMOZILLA_INTERNAL_API $(RPM_OPT_FLAGS)
! +LDFLAGS  := -ggdb -s -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -D_REENTRANT -Wl,-shared-gcc $(LDFLAGS)
!  
!  #-------------------------------------------------------------------------------
!  # Rules

Index: Mozilla.java
===================================================================
RCS file: /home/projects/jpackage/cvs/dist/gwt/devel/Mozilla.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** Mozilla.java	25 Feb 2009 21:20:49 -0000	1.1
--- Mozilla.java	26 Feb 2009 23:03:23 -0000	1.2
***************
*** 9,17 ****
   *     IBM Corporation - initial API and implementation
   *******************************************************************************/
- // Modified by Google
  package org.eclipse.swt.browser;
  
- import com.google.gwt.dev.shell.moz.LowLevelMoz; // GOOGLE
- 
  import java.io.*;
  import java.lang.reflect.*;
--- 9,14 ----
[...1685 lines suppressed...]
  		if (rc != XPCOM.NS_OK) error (rc);
--- 3020,3024 ----
  
  	if (XPCOM.DOMEVENT_KEYUP.equals (typeString)) {
! 		int /*long*/[] result = new int /*long*/[1];
  		rc = domEvent.QueryInterface (nsIDOMKeyEvent.NS_IDOMKEYEVENT_IID, result);
  		if (rc != XPCOM.NS_OK) error (rc);
***************
*** 3139,3143 ****
  	/* mouse event */
  
! 	long[] result = new long[1];
  	rc = domEvent.QueryInterface (nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID, result);
  	if (rc != XPCOM.NS_OK) error (rc);
--- 3077,3081 ----
  	/* mouse event */
  
! 	int /*long*/[] result = new int /*long*/[1];
  	rc = domEvent.QueryInterface (nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID, result);
  	if (rc != XPCOM.NS_OK) error (rc);

--- NEW FILE: gwt-mozilla-google.patch ---
--- gwt-1.6.0/dev/linux/src/org/eclipse/swt/browser/Mozilla.java.orig	2009-02-26 17:10:28.872235198 -0500
+++ gwt-1.6.0/dev/linux/src/org/eclipse/swt/browser/Mozilla.java	2009-02-26 17:12:55.798361149 -0500
@@ -8,8 +8,11 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
+// Modified by Google
 package org.eclipse.swt.browser;
 
+import com.google.gwt.dev.shell.moz.LowLevelMoz; // GOOGLE
+
 import java.io.*;
 import java.lang.reflect.*;
 import java.util.*;
@@ -167,7 +170,18 @@
 			Initialized = true;
 		}
 
-		String mozillaPath = System.getProperty (XULRUNNER_PATH);
+		/*
+		* GOOGLE: We ship our own bundled version of Mozilla; the
+		* bootstrap process stores the path of the one we loaded in
+		* the system property swt.mozilla.path, so we get it from
+		* there rather than using SWT's normal process to find it.
+		*/
+		String mozillaPath = System.getProperty("swt.mozilla.path");
+
+		if (mozillaPath == null) {
+			mozillaPath = System.getProperty (XULRUNNER_PATH);
+		}
+
 		/*
 		* Browser clients that ship XULRunner in a plug-in must have an opportunity 
 		* to set the org.eclipse.swt.browser.XULRunnerPath system property to point
@@ -912,6 +926,13 @@
 		componentManager.Release ();
 
 		Initialized = true;
+
+		/*
+		* GOOGLE: If we don't force LowLevel into existence during this narrow
+		* window of opportunity, registering our "window.external" handler seems
+		* to have no effect.
+		*/
+		LowLevelMoz.init();
 	}
 
 	if (display.getData (DISPOSE_LISTENER_HOOKED) == null) {

--- NEW FILE: gwt-mozilla-64.patch ---
--- gwt-1.6.0/dev/linux/src/org/eclipse/swt/browser/Mozilla.java.orig	2008-06-05 13:31:50.000000000 -0700
+++ gwt-1.6.0/dev/linux/src/org/eclipse/swt/browser/Mozilla.java	2008-06-17 20:55:54.000000000 -0700
@@ -21,7 +21,7 @@
 import org.eclipse.swt.layout.*;
 
 class Mozilla extends WebBrowser {
-	int /*long*/ embedHandle;
+	long /*int*/ embedHandle;
 	nsIWebBrowser webBrowser;
 	Object webBrowserObject;
 	MozillaDelegate delegate;
@@ -41,7 +41,7 @@
 	XPCOMObject domEventListener;
 	int chromeFlags = nsIWebBrowserChrome.CHROME_DEFAULT;
 	int refCount, lastKeyCode, lastCharCode;
-	int /*long*/ request;
+	long /*int*/ request;
 	Point location, size;
 	boolean visible, isChild, ignoreDispose, awaitingNavigate;
[...1261 lines suppressed...]
@@ -14,7 +14,7 @@
  * Signature: (Ljava/lang/Object;)I
  */
 JNIEXPORT jint JNICALL Java_com_google_gwt_dev_shell_LowLevel__1newGlobalRefInt(JNIEnv* env, jclass, jobject o) {
-	return reinterpret_cast<int>(env->NewGlobalRef(o));
+	return reinterpret_cast<long>(env->NewGlobalRef(o));
 }
 /*
  * Class:     com_google_gwt_dev_shell_LowLevel
--- gwt-1.6.0/jni/linux/LowLevelMoz.cpp~	2009-02-26 13:46:15.000000000 -0500
+++ gwt-1.6.0/jni/linux/LowLevelMoz.cpp	2009-02-26 13:57:05.352235569 -0500
@@ -350,7 +350,7 @@
   Tracer tracer("LowLevelMoz._registerExternalFactoryHandler");
 
   char buf[256];
-  sprintf(buf, " jniEnv=%08x, llClass=%08x", (unsigned)env, (unsigned)llClass);
+  sprintf(buf, " jniEnv=%08lx, llClass=%08lx", (long)env, (long)llClass);
   tracer.log(buf);
   int *result = new int[1];
   nsCOMPtr<nsIComponentRegistrar> registrar;

Index: gwt.spec
===================================================================
RCS file: /home/projects/jpackage/cvs/dist/gwt/devel/gwt.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -C 2 -d -r1.2 -r1.3
*** gwt.spec	25 Feb 2009 21:20:49 -0000	1.2
--- gwt.spec	26 Feb 2009 23:03:24 -0000	1.3
***************
*** 61,66 ****
  Patch0:         gwt-build.patch
  Patch1:         gwt-java6.patch
! Patch2:         gwt-mozilla.patch
! Patch3:         gwt-tomcat.patch
  Requires(post): jpackage-utils >= 0:1.7.3
  Requires(postun): jpackage-utils >= 0:1.7.3
--- 61,69 ----
  Patch0:         gwt-build.patch
  Patch1:         gwt-java6.patch
! Patch2:         gwt-tomcat.patch
! Patch3:         gwt-mozilla.patch
! Patch4:         gwt-mozilla-64.patch
! Patch5:         gwt-mozilla-google.patch
! Patch6:         gwt-tomcat-google.patch
  Requires(post): jpackage-utils >= 0:1.7.3
  Requires(postun): jpackage-utils >= 0:1.7.3
***************
*** 124,152 ****
  %setup -q
  %{_bindir}/find -type f \( -name "*.jar" -o -name "*.so" \) | %{_bindir}/xargs -t %{__rm}
  %patch0 -p1 -b .build
  %patch1 -p1 -b .java6
! %patch2 -p1 -b .mozilla
! %patch3 -p1 -b .tomcat
  
! XULRUNNER_PATH=$(%{_bindir}/dirname $(%{_bindir}/xulrunner --find-gre $(%{_bindir}/xulrunner --gre-version)))
  %{__perl} -pi -e "s|\@XULRUNNER_PATH\@|"${XULRUNNER_PATH}"|g;" \
                -e "s|\@LIBDIR\@|%{_libdir}|g;" \
                -e "s|\@NAME\@|%{name}|g;" \
                -e "s|\@SYSCONFDIR\@|%{_sysconfdir}|g;" \
-   %{SOURCE7} \
-   %{SOURCE8} \
-   %{SOURCE9} \
-   %{SOURCE10} \
    dev/core/src/com/google/gwt/dev/shell/LowLevel.java \
    dev/linux/src/com/google/gwt/dev/shell/moz/MozillaInstall.java \
!   distro-source/linux/src/mozilla-hosted-browser.conf
! 
! %{__rm} dev/linux/src/org/eclipse/swt/browser/Browser.java
! %{__rm} dev/linux/src/org/eclipse/swt/internal/Library.java
! %{__cp} -p %{SOURCE5} dev/linux/src/org/eclipse/swt/browser/Mozilla.java
! 
! %{__rm} dev/core/src/com/google/gwt/dev/shell/tomcat/CatalinaLoggerAdapter.java
! %{__rm} dev/core/src/org/apache/catalina/loader/WebappClassLoader.java
! %{__cp} -p %{SOURCE6} dev/core/src/org/apache/catalina/loader/WebappClassLoader.java
  
  %{__mkdir_p} tools
--- 127,160 ----
  %setup -q
  %{_bindir}/find -type f \( -name "*.jar" -o -name "*.so" \) | %{_bindir}/xargs -t %{__rm}
+ 
+ %{__rm} dev/linux/src/org/eclipse/swt/browser/Browser.java
+ %{__rm} dev/linux/src/org/eclipse/swt/internal/Library.java
+ %{__cp} -p %{SOURCE5} dev/linux/src/org/eclipse/swt/browser/Mozilla.java
+ 
+ %{__rm} dev/core/src/com/google/gwt/dev/shell/tomcat/CatalinaLoggerAdapter.java
+ %{__rm} dev/core/src/org/apache/catalina/loader/WebappClassLoader.java
+ %{__cp} -p %{SOURCE6} dev/core/src/org/apache/catalina/loader/WebappClassLoader.java
+ 
  %patch0 -p1 -b .build
  %patch1 -p1 -b .java6
! %patch2 -p1 -b .tomcat
! %patch3 -p1 -b .mozilla
! %ifarch x86_64
! %patch4 -p1 -b .mozilla-64
! %endif
! %patch5 -p1 -b .mozilla-google
! %patch6 -p1 -b .tomcat-google
  
! XULRUNNER_PATH=`%{_bindir}/pkg-config --variable=libdir libxul`
! XULRUNNER_SDKDIR=`%{_bindir}/pkg-config --variable=sdkdir libxul`
  %{__perl} -pi -e "s|\@XULRUNNER_PATH\@|"${XULRUNNER_PATH}"|g;" \
+               -e "s|\@XULRUNNER_SDKDIR\@|"${XULRUNNER_SDKDIR}"|g;" \
                -e "s|\@LIBDIR\@|%{_libdir}|g;" \
                -e "s|\@NAME\@|%{name}|g;" \
                -e "s|\@SYSCONFDIR\@|%{_sysconfdir}|g;" \
    dev/core/src/com/google/gwt/dev/shell/LowLevel.java \
    dev/linux/src/com/google/gwt/dev/shell/moz/MozillaInstall.java \
!   distro-source/linux/src/mozilla-hosted-browser.conf \
!   jni/linux/Makefile
  
  %{__mkdir_p} tools
***************
*** 154,157 ****
--- 162,166 ----
  %build
  SWT_JAR=$(build-classpath swt 2>/dev/null)
+ [ -n "${SWT_JAR}" ] || exit 1
  export CLASSPATH=$(build-classpath ant-contrib antlr checkstyle ecj jakarta-commons-beanutils jakarta-commons-collections jakarta-commons-logging jetty6/core/jetty6 jetty6/core/jetty6-util jcommon jfreechart junit selenium-java-client-driver servlet_2_5_api tapestry/tapestry tomcat6/catalina tomcat6/naming-resources tomcat6/tomcat-util):${SWT_JAR}:%{_datadir}/tomcat6/bin/tomcat-juli.jar
  export CLASSPATH=${CLASSPATH}:`%{_bindir}/find $(pwd)/tools/ -type f -name "*.jar" | tr '\n' ':'`
***************
*** 162,166 ****
  
  pushd jni/linux
! %{__make} clean all
  popd
  
--- 171,175 ----
  
  pushd jni/linux
! %{__make} STRIP=: RPM_OPT_FLAGS="%{optflags}" clean all
  popd
  
***************
*** 203,210 ****
  %{__mkdir_p} %{buildroot}%{_bindir}
  %{__cp} -p %{SOURCE7} %{buildroot}%{_bindir}/%{name}-benchmarkViewer
- %{__perl} -pi -e 's|\@LIBDIR\@|%{_libdir}|g' %{buildroot}%{_bindir}/%{name}-benchmarkViewer
  %{__cp} -p %{SOURCE8} %{buildroot}%{_bindir}/%{name}-i18nCreator
  %{__cp} -p %{SOURCE9} %{buildroot}%{_bindir}/%{name}-junitCreator
  %{__cp} -p %{SOURCE10} %{buildroot}%{_bindir}/%{name}-webAppCreator
  %if 0
  for script in benchmarkViewer i18nCreator junitCreator webAppCreator; do %{__cp} -p ${script} %{buildroot}%{_datadir}/%{name}/${script}; done
--- 212,229 ----
  %{__mkdir_p} %{buildroot}%{_bindir}
  %{__cp} -p %{SOURCE7} %{buildroot}%{_bindir}/%{name}-benchmarkViewer
  %{__cp} -p %{SOURCE8} %{buildroot}%{_bindir}/%{name}-i18nCreator
  %{__cp} -p %{SOURCE9} %{buildroot}%{_bindir}/%{name}-junitCreator
  %{__cp} -p %{SOURCE10} %{buildroot}%{_bindir}/%{name}-webAppCreator
+ 
+ XULRUNNER_PATH=`%{_bindir}/pkg-config --variable=libdir libxul`
+ %{__perl} -pi -e "s|\@XULRUNNER_PATH\@|"${XULRUNNER_PATH}"|g;" \
+               -e "s|\@LIBDIR\@|%{_libdir}|g;" \
+               -e "s|\@NAME\@|%{name}|g;" \
+               -e "s|\@SYSCONFDIR\@|%{_sysconfdir}|g;" \
+     %{buildroot}%{_bindir}/%{name}-benchmarkViewer \
+     %{buildroot}%{_bindir}/%{name}-i18nCreator \
+     %{buildroot}%{_bindir}/%{name}-junitCreator \
+     %{buildroot}%{_bindir}/%{name}-webAppCreator
+ 
  %if 0
  for script in benchmarkViewer i18nCreator junitCreator webAppCreator; do %{__cp} -p ${script} %{buildroot}%{_datadir}/%{name}/${script}; done




More information about the JPackage-commits mailing list