This commit was manufactured by cvs2svn to create tag 'WEBCLIENT_20020830'.

git-svn-id: svn://10.0.0.236/tags/WEBCLIENT_20020830@128608 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
(no author)
2002-08-31 02:46:41 +00:00
parent 2d3428567f
commit 8444df00a7
37236 changed files with 0 additions and 9521686 deletions

View File

@@ -1,5 +0,0 @@
Fri Jul 30 14:57:28 1999 Ed Burns <Ed Burns <ed.burns@sun.com>>
* Made necessary changes to build files to build with jdk1.1.7 or
jdk1.2.2.

View File

@@ -1,30 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: Defs.gmk,v 1.2 2001-07-12 19:57:32 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
MAKEFLAGS += --no-print-directory
RM = rm -f
JAVAC_CMD = $(WFJDKHOME)/bin/javac
JAR_CMD = $(WFJDKHOME)/bin/jar
MV = mv

View File

@@ -1,63 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: FileListCommon.mk,v 1.2 2001-07-12 19:57:33 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
FILES_java = \
sun/jvmp/ConsoleWindow.java \
sun/jvmp/DebugOutputStream.java \
sun/jvmp/HostObjectPeer.java \
sun/jvmp/PluggableJVM.java \
sun/jvmp/ObjectFactory.java \
sun/jvmp/BrowserSupport.java \
sun/jvmp/IDObject.java \
sun/jvmp/IDList.java \
sun/jvmp/NativeFrame.java \
sun/jvmp/NativeThread.java \
sun/jvmp/SynchroObject.java \
sun/jvmp/WaterfallExtension.java \
sun/jvmp/MultipleHashtable.java \
sun/jvmp/ComponentException.java \
sun/jvmp/HostObjectPeerFactory.java \
sun/jvmp/ComponentLoader.java \
sun/jvmp/test/MyDialog.java \
sun/jvmp/test/MyActionListener.java \
sun/jvmp/test/TestPeerFactory.java \
sun/jvmp/security/SecurityCaps.java \
sun/jvmp/security/ExtSecurityManager.java \
sun/jvmp/security/AccessControlDecider.java \
sun/jvmp/security/CallingContext.java \
sun/jvmp/security/WFPolicy.java \
netscape/javascript/JSObject.java \
netscape/javascript/JSException.java \
netscape/javascript/JSUtil.java \
sun/jvmp/javascript/JSContext.java \
sun/jvmp/generic/GenericSynchroObject.java \
sun/jvmp/applet/WFAppletViewer.java \
sun/jvmp/applet/AppletManager.java \
sun/jvmp/applet/WFAppletContext.java \
sun/jvmp/applet/WFAppletClassLoader.java \
sun/jvmp/applet/WFAppletSecurityManager.java \
sun/jvmp/applet/AppletViewerArgs.java \
sun/jvmp/applet/ProxyInfo.java \
sun/jvmp/applet/ProxyType.java \
sun/jvmp/applet/ProxyHandler.java

View File

@@ -1,27 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: FileListUnix.mk,v 1.2 2001-07-12 19:57:33 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
FILES_java += \
sun/jvmp/generic/motif/Plugin.java \
sun/jvmp/generic/motif/PthreadSynchroObject.java

View File

@@ -1,26 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: FileListWin.mk,v 1.2 2001-07-12 19:57:33 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
FILES_java=$(FILES_java)\
sun/jvmp/generic/win32/Plugin.java

View File

@@ -1,63 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: GNUmakefile,v 1.3 2001-07-12 19:57:33 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
ifndef WFJDKHOME
all classes:
@echo
@echo "Set your WFJDKHOME to path to JDK!"
@echo
else
BUILDDIR = .
JAVASRCDIR = ../../java
CLASSDESTDIR = ../unix/classes
ADDCLASSPATH = ../unix/classes
SUBDIRS = ext
default: all
include FileListCommon.mk
include FileListUnix.mk
include $(BUILDDIR)/Defs.gmk
include $(BUILDDIR)/Rules.gmk
endif
all: classes exts
release: all wf.jar
wf.jar:
@echo -n "Making JAR file....."; \
cd $(CLASSDESTDIR); \
$(JAR_CMD) cf wf.jar sun netscape ; \
$(MV) wf.jar ..; \
echo " done."
exts:
@echo "Making Waterfall extension components"
@cd ext; \
$(MAKE) all
.PHONY : all classes clean exts

View File

@@ -1,66 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: Rules.gmk,v 1.2 2001-07-12 19:57:33 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
$(CLASSDESTDIR):
@mkdir -p $@
.delete.classlist:
@$(RM) .classes.list
.compile.classlist:
@if [ -s .classes.list ] ; \
then echo "Compiling Java files"; cat .classes.list; \
$(JAVAC_CMD) -deprecation -d $(CLASSDESTDIR) -classpath $(CLASSDESTDIR) -classpath $(ADDCLASSPATH)\
$(shell if [ -s .classes.list ] ; then cat .classes.list; fi ) ; \
fi
FILES_class = $(FILES_java:%.java=$(CLASSDESTDIR)/%.class)
ifdef SUBDIRS
LOOP_OVER_DIRS = @for d in $(SUBDIRS); do \
oldDir=`pwd`; \
set -e; \
cd $$d; $(MAKE) $@; cd $$oldDir; \
set +e; \
done
endif
$(CLASSDESTDIR)/%.class: $(JAVASRCDIR)/%.java
@echo $? >>.classes.list
classes: $(CLASSES_INIT) $(CLASSDESTDIR) .delete.classlist $(FILES_class) .compile.classlist
clean:
@echo "Removing compiled classfiles from $(CLASSDESTDIR)"
@$(RM) -r $(CLASSDESTDIR) .classes.list
$(LOOP_OVER_DIRS)
.PHONY: .delete.classlist .compile.classlist

View File

@@ -1,29 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: defs.mk,v 1.2 2001-07-12 19:57:34 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
DEL=del/f/q
DELTREE=rmdir/s/q
MV=move
JAVAC_CMD=$(WFJDKHOME)\bin\javac.exe
JAR_CMD = $(WFJDKHOME)\bin\jar.exe

View File

@@ -1,33 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: GNUmakefile,v 1.2 2001-07-12 19:57:36 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
SUBDIRS = moz6 av
all clean:
@for i in $(SUBDIRS) ; do \
echo ">>>Recursively making "$$i" "$@"..."; \
cd $$i; $(MAKE) $@ \
|| exit 1; cd ..; \
echo "<<<Finished Recursively making "$$i" "$@"." ; \
done

View File

@@ -1,33 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: FileListExt.mk,v 1.1 2001-07-12 20:25:23 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
FILES_java = \
sun/jvmp/av/WFAppletViewerImpl.java \
sun/jvmp/av/AVFactory.java \
sun/jvmp/av/WFProxyHandler.java \
sun/jvmp/av/WFAppletPanel.java \
sun/jvmp/av/AVClassLoader.java \
sun/jvmp/av/WFAuthenticatorImpl.java \
sun/jvmp/av/protocol/http/Handler.java \
sun/jvmp/av/protocol/http/HttpURLConnection.java

View File

@@ -1,47 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: GNUmakefile,v 1.1 2001-07-12 20:25:24 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
BUILDDIR = ../..
JAVASRCDIR = ../../../../java
CLASSDESTDIR = ../../../unix/ext/av
ADDCLASSPATH=../../../unix/classes:../../../unix/ext/av
include FileListExt.mk
include $(BUILDDIR)/Defs.gmk
include $(BUILDDIR)/Rules.gmk
all: av.jar
av.jar: classes
@if [ -s .classes.list ]; then \
echo -n "Creating av.jar..."; \
cd $(CLASSDESTDIR); \
$(RM) manifest.tmp; \
echo "Factory-Class: sun.jvmp.av.AVFactory" >> manifest.tmp ; \
$(JAR_CMD) cfm av.jar manifest.tmp sun ; \
$(MV) av.jar .. ;\
echo " done."; fi

View File

@@ -1,57 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: makefile.win,v 1.1 2001-07-12 20:25:25 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
BUILDDIR = ..\..
JAVASRCDIR = ..\..\..\..\java
CLASSDESTDIR = ..\..\..\win32\ext\av
ADDCLASSPATH=..\..\..\win32\classes;..\..\..\win32\ext\av
PKG3=sun.jvmp.av
PKG4=sun.jvmp.av.protocol.http
PKG15=sun.jvmp.av.protocol.https
PKG16=sun.jvmp.av.protocol.ftp
PKG17=sun.jvmp.av.protocol.gopher
!include FileListExt.mk
# ugly, but nmake is pretty stupid in substitutions
CLASSDESTDIR=..\..\..\win32\ext\av
FILES_class = $(FILES_java:sun/jvmp=../../../win32/ext/av/sun/jvmp)
!include $(BUILDDIR)\defs.mk
!include $(BUILDDIR)\rules.mk
all: av.jar
av.jar: classes
@IF EXIST manifest.tmp $(DEL) manifest.tmp
@ echo Creating av.jar...
@ cd $(CLASSDESTDIR)
@$(JAR_CMD) cfm av.jar <<manifest.tmp sun
Factory-Class: sun.jvmp.av.AVFactory
<<
-@$(DEL) ..\av.jar manifest.tmp
@$(MV) av.jar ..
@ echo Done

View File

@@ -1,30 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: makefile.win,v 1.2 2001-07-12 19:57:36 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
all clean:
@ cd moz6
@ $(MAKE) -fmakefile.win -nologo $@
@ cd ..\av
@ $(MAKE) -fmakefile.win -nologo $@

View File

@@ -1,34 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: FileListExt.mk,v 1.3 2001-07-18 20:48:15 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
FILES_java =\
sun/jvmp/mozilla/MozillaAppletPeer.java \
sun/jvmp/mozilla/MozillaHostObjectPeer.java \
sun/jvmp/mozilla/MozillaPeerFactory.java \
sun/jvmp/mozilla/MozillaSecurityManager.java \
sun/jvmp/mozilla/JSObject.java \
sun/jvmp/mozilla/SecureInvocation.java \
sun/jvmp/mozilla/JavaScriptProtectionDomain.java \
sun/jvmp/mozilla/JSPermission.java

View File

@@ -1,45 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: GNUmakefile,v 1.2 2001-07-12 19:57:37 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
BUILDDIR = ../..
JAVASRCDIR = ../../../../java
CLASSDESTDIR = ../../../unix/ext/moz6
ADDCLASSPATH=../../../unix/classes:../../../unix/ext/moz6
include FileListExt.mk
include $(BUILDDIR)/Defs.gmk
include $(BUILDDIR)/Rules.gmk
all: moz6.jar
moz6.jar: classes
@if [ -s .classes.list ]; then \
echo -n "Creating moz6.jar..." ;\
cd $(CLASSDESTDIR) ;\
$(JAR_CMD) cf moz6.jar sun ; \
$(MV) moz6.jar .. ;\
echo " done."; fi

View File

@@ -1,49 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: makefile.win,v 1.2 2001-07-12 19:57:38 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
BUILDDIR = ..\..
JAVASRCDIR = ..\..\..\..\java
CLASSDESTDIR = ..\..\..\win32\ext\moz6
ADDCLASSPATH=..\..\..\win32\classes;..\..\..\win32\ext\moz6
PKG3=sun.jvmp.mozilla
!include FileListExt.mk
# ugly, but nmake is pretty stupid in substitutions
CLASSDESTDIR=..\..\..\win32\ext\moz6
FILES_class = $(FILES_java:sun/jvmp=../../../win32/ext/moz6/sun/jvmp)
!include $(BUILDDIR)\defs.mk
!include $(BUILDDIR)\rules.mk
all: moz6.jar
moz6.jar: classes
@ echo Creating moz6.jar...
@ cd $(CLASSDESTDIR)
@ $(JAR_CMD) cf moz6.jar sun
-@ $(DEL) ..\moz6.jar > NUL
@ $(MV) moz6.jar ..
@ echo Done

View File

@@ -1,70 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: makefile.win,v 1.3 2001-07-12 19:57:34 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
PKG=sun.jvmp
PKG2=sun.jvmp.applet
PKG6=sun.jvmp.mozilla
PKG7=sun.jvmp.netscape4
PKG8=sun.jvmp.security
PKG9=sun.jvmp.javascript
PKG10=netscape.javascript
PKG11=sun.jvmp.generic.win32
PKG12=sun.jvmp.test
PKG13=sun.jvmp.generic
BUILDDIR=.
JAVASRCDIR=..\..\java
ADDCLASSPATH=..\win32\classes
SUBDIRS=ext
!include FileListCommon.mk
!include FileListWin.mk
# ugly, but nmake is pretty stupid in substitutions
CLASSDESTDIR=..\win32\classes
FILES_class = $(FILES_java:sun/jvmp=../win32/classes/sun/jvmp)
FILES_class = $(FILES_class:netscape/javascript=../win32/classes/netscape/javascript)
!include defs.mk
!include rules.mk
all: classes exts
release: all wf.jar
exts:
@ cd ext
@ $(MAKE) -f makefile.win -nologo all
@ cd ..
wf.jar:
@ echo Creating wf.jar...
@ cd $(CLASSDESTDIR)
@ $(JAR_CMD) cf wf.jar sun netscape > NUL
@ echo Done
-@$(DEL) ..\wf.jar
@$(MV) wf.jar ..
.PHONY : all classes clean release exts

View File

@@ -1,107 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: rules.mk,v 1.2 2001-07-12 19:57:34 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
# nmake isn't the best make program I know about
FILES_class = $(FILES_class:.java=.class)
FILES_class=$(FILES_class:/=\)
PKG1_DIR=$(PKG:.=\)
PKG2_DIR=$(PKG2:.=\)
PKG3_DIR=$(PKG3:.=\)
PKG4_DIR=$(PKG4:.=\)
PKG5_DIR=$(PKG5:.=\)
PKG6_DIR=$(PKG6:.=\)
PKG7_DIR=$(PKG7:.=\)
PKG8_DIR=$(PKG8:.=\)
PKG9_DIR=$(PKG9:.=\)
PKG10_DIR=$(PKG10:.=\)
PKG11_DIR=$(PKG11:.=\)
PKG12_DIR=$(PKG12:.=\)
PKG13_DIR=$(PKG13:.=\)
PKG14_DIR=$(PKG14:.=\)
PKG15_DIR=$(PKG15:.=\)
PKG16_DIR=$(PKG16:.=\)
PKG17_DIR=$(PKG17:.=\)
PKG18_DIR=$(PKG18:.=\)
{$(JAVASRCDIR)\$(PKG1_DIR)\}.java{$(CLASSDESTDIR)\$(PKG1_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG2_DIR)\}.java{$(CLASSDESTDIR)\$(PKG2_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG3_DIR)\}.java{$(CLASSDESTDIR)\$(PKG3_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG4_DIR)\}.java{$(CLASSDESTDIR)\$(PKG4_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG5_DIR)\}.java{$(CLASSDESTDIR)\$(PKG5_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG6_DIR)\}.java{$(CLASSDESTDIR)\$(PKG6_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG7_DIR)\}.java{$(CLASSDESTDIR)\$(PKG7_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG8_DIR)\}.java{$(CLASSDESTDIR)\$(PKG8_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG9_DIR)\}.java{$(CLASSDESTDIR)\$(PKG9_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG10_DIR)\}.java{$(CLASSDESTDIR)\$(PKG10_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG11_DIR)\}.java{$(CLASSDESTDIR)\$(PKG11_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG12_DIR)\}.java{$(CLASSDESTDIR)\$(PKG12_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG13_DIR)\}.java{$(CLASSDESTDIR)\$(PKG13_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG14_DIR)\}.java{$(CLASSDESTDIR)\$(PKG14_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG15_DIR)\}.java{$(CLASSDESTDIR)\$(PKG15_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG16_DIR)\}.java{$(CLASSDESTDIR)\$(PKG16_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG17_DIR)\}.java{$(CLASSDESTDIR)\$(PKG17_DIR)\}.class:
@echo $(?) >>.classes.list
{$(JAVASRCDIR)\$(PKG18_DIR)\}.java{$(CLASSDESTDIR)\$(PKG18_DIR)\}.class:
@echo $(?) >>.classes.list
.SUFFIXES:
.SUFFIXES: .java .class
classes: $(CLASSES_INIT) $(CLASSDESTDIR) delete.classlist $(FILES_class) compile.classlist
$(CLASSDESTDIR):
@mkdir $@
delete.classlist:
@if exist .classes.list $(DEL) .classes.list
compile.classlist:
@if exist .classes.list echo "Compiling Java classes"
@if exist .classes.list type .classes.list
@if exist .classes.list $(JAVAC_CMD) -d $(CLASSDESTDIR) -classpath $(CLASSDESTDIR) -classpath $(ADDCLASSPATH) \
@.classes.list
clean:
@ echo Remove classfiles from $(CLASSDESTDIR)
@ IF EXIST $(CLASSDESTDIR) $(DELTREE) $(CLASSDESTDIR)
@ IF EXIST .classes.list $(DEL) .classes.list
.PHONY: delete.classlist compile.classlist classes

View File

@@ -1,128 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: Defs.gmk,v 1.2 2001-07-12 19:57:39 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
BUILDDIR=.
ROOTDIR=../..
MAKE = gmake
CXX = g++ -Wall -Wno-long-long
CC = gcc -pedantic -Wall -Wno-long-long
LD = gcc
CCOPT = -g
CP = cp
TAR = tar
ECHO = echo
# type of really used JVM
# values: _JVMP_IBMJVM, _JVMP_SUNJVM
#JVMTYPE = _JVMP_IBMJVM
JVMTYPE = _JVMP_SUNJVM
# use hotspot for older 1.3 and client for 1.3.1 and 1.4
#JVMKIND = hotspot
#JVMKIND = classic
JVMKIND = client
# using pthreads, should be defined by smth like configure
THREADTYPE = _JVMP_PTHREADS
# use shared memory and 2 process approach
USE_SHM = 0
# set to 1 if you want to compile pJava-compatible WF
WF_PJAVA = 0
uname = $(shell uname)
ifeq ($(uname), SunOS)
PLATFORM = solaris
endif
ifeq ($(uname), Linux)
PLATFORM = linux
endif
archExpr = case "`uname -m`" in \
i[3-6]86) \
echo i386 \
;; \
i86pc) \
echo i386 \
;; \
sparc*) \
echo sparc \
;; \
sun4u) \
echo sparc \
;; \
*) \
uname -m \
;; \
esac
ARCH = $(shell $(archExpr) )
CCDEBUG =
PICFLAGS = -fPIC -DPIC
INCLUDES = -I$(ROOTDIR)/include -I$(ROOTDIR)/include/$(PLATFORM) -I../../public -I../../public/$(PLATFORM) -I$(WFJDKHOME)/include -I$(WFJDKHOME)/include/$(PLATFORM)
EXTRA_CFLAGS = $(CCOPT) $(CCDEBUG)
CFLAGS = -D_REENTRANT $(PICFLAGS) $(EXTRA_CFLAGS) $(INCLUDES) -D$(JVMTYPE) -D$(THREADTYPE) -DXP_UNIX -D_GNU_SOURCE -D_JVMP_IMPLEMENTATION
LIBFLAGS = -shared $(CCDEBUG)
ifeq ($(PLATFORM),linux)
CFLAGS += -rdynamic
XLIBS= -L/usr/X11R6/lib -lXt
PLUGINLIBS=-ldl
HOSTLIBS= -ldl -lpthread $(GTKLIBS)
INCLUDES += -I/usr/X11R6/include
CXXFLAGS=
endif
ifeq ($(PLATFORM),solaris)
XLIBS= -L/usr/openwin/lib -lXt
PLUGINLIBS=-ldl -lthread
HOSTLIBS= -ldl -lthread $(GTKLIBS)
INCLUDES += -I/usr/openwin/include
CXXFLAGS= -fpermissive
endif
GTKLIBS = $(shell gtk-config --libs)
GTKCFLAGS = $(shell gtk-config --cflags)
CFLAGS += -DARCH="\"$(ARCH)\"" -DJVMKIND="\"$(JVMKIND)\"" -DPLATFORM="\"$(PLATFORM)\""
CXXFLAGS += $(GTKCFLAGS) $(INCLUDES) -DXP_UNIX
ifeq ($(USE_SHM), 1)
CFLAGS += -DJVMP_USE_SHM
else
PLUGINLIBS+=-lpthread
endif
ifeq ($(WF_PJAVA), 1)
CFLAGS += -DWF_PJAVA
endif

View File

@@ -1,182 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: GNUmakefile,v 1.2 2001-07-12 19:57:39 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
include Defs.gmk
#___________________________________________________________________
# sources of Java Plugin DLL
PLUGINCSRCDIR = ../../src/plugin
ifeq ($(USE_SHM), 1)
PLUGINCSRCS = shmtran.c java_plugin_shm.c
PLUGIN_DLL = libjvmp_shm.so
else
PLUGINCSRCS = jpthreads.c java_plugin.c
PLUGIN_DLL = libjvmp.so
endif
# source of native methods og WF
PLUGINNATIVESRC=native.c
# native methods of Waterfall itself
PLUGIN_NATIVE_DLL = libJVMPnatives.so
# source of Mozilla-dependent module - should be separeated
MOZEXTSRCDIR = ../../src/plugin/mozilla
MOZEXTCSRC = wfe_mozilla.c wfm6_native.c
MOZEXT_DLL = libwf_moz6.so
PRELOAD_HACK = Helper.libXm.so.4
TESTEXTSRCDIR = ../../src/host
TESTEXTCSRC = test_extension.c
TESTEXT_DLL = libwf_test.so
# source of Netscape4x-dependent module - should be separeated
NCEXTSRCDIR = ../../src/plugin/netscape4
NCEXTCSRC = wfe_netscape4.c shmtran.c
NCEXT_DLL = libwf_netscape4.so
HOSTCPPSRCDIR = ../../src/host
HOSTCPPSRCS = host.cpp
HOSTPROG = plugin_host
VPATH=$(PLUGINCSRCDIR):$(HOSTCPPSRCDIR):$(MOZEXTSRCDIR):$(NCEXTSRCDIR):$(TESTEXTSRCDIR):$(PLUGINCSRCDIR)/unix
PLUGINOBJS=$(PLUGINCSRCS:%.c=%.o)
PLUGIN_NATIVE_OBJS=$(PLUGINNATIVESRC:%.c=%.o)
HOSTOBJS=$(HOSTCPPSRCS:%.cpp=%.o)
MOZEXTOBJS = $(MOZEXTCSRC:%.c=%.o)
NCEXTOBJS = $(NCEXTCSRC:%.c=%.o)
TESTEXTOBJS=$(TESTEXTCSRC:%.c=%.o)
all: sane
release: all
@ cd ../java; $(MAKE) release
@ rm -rf wfrelease; mkdir wfrelease; mkdir wfrelease/ext
@ cp $(PRELOAD_HACK) wfrelease
@ cp wf.jar wfrelease
@ cp $(PLUGIN_DLL) wfrelease
@ cp $(MOZEXT_DLL) wfrelease
@ cp $(PLUGIN_NATIVE_DLL) wfrelease
@ cp plugin.policy wfrelease
@ cp set_paths wfrelease
@ cp ext/*.jar wfrelease/ext
@ $(TAR) czf wf-bin.tgz wfrelease
@ echo "Release is wf-bin.tgz"
.SUFFIXES:
.SUFFIXES: .cpp .c .o
.cpp.o:
$(CXX) $(CXXFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
ifndef WFJDKHOME
sane:
@echo
@echo "Set WFJDKHOME before"
@echo
else
sane: GNUmakefile plugin host_prog ext plugin.policy
endif
natives: plugin_no_java host_prog
plugin_no_java: plugin_objs plugin_dll plugin_native_dll plugin_exec
plugin: plugin_no_java java
plugin_objs: $(PLUGINOBJS) $(PLUGIN_NATIVE_OBJS)
plugin_dll: $(PLUGIN_DLL)
ext: $(MOZEXT_DLL) $(NCEXT_DLL) $(TESTEXT_DLL) $(PRELOAD_HACK)
$(MOZEXT_DLL): $(MOZEXTOBJS)
$(LD) $(LIBFLAGS) -o $(MOZEXT_DLL) $(MOZEXTOBJS)
cp -f $(MOZEXT_DLL) libwf_moz6_g.so
$(PRELOAD_HACK): ../../src/plugin/mozilla/XmHelper.c
gcc -D_GNU_SOURCE -O2 -fPIC -shared ../../src/plugin/mozilla/XmHelper.c -o $(PRELOAD_HACK) -ldl
$(TESTEXT_DLL): $(TESTEXTOBJS)
$(LD) $(LIBFLAGS) -o $(TESTEXT_DLL) $(TESTEXTOBJS)
cp -f $(TESTEXT_DLL) libwf_test_g.so
ifeq ($(USE_SHM), 1)
$(NCEXT_DLL): $(NCEXTOBJS)
$(LD) $(LIBFLAGS) -o $(NCEXT_DLL) $(NCEXTOBJS)
cp -f $(NCEXT_DLL) libwf_netscape4_g.so
else
$(NCEXT_DLL):
@echo "Not building Netscape 4 extension if SHM disabled"
endif
$(PLUGIN_DLL): $(PLUGINOBJS)
$(LD) $(LIBFLAGS) -o $(PLUGIN_DLL) $(PLUGINOBJS) $(PLUGINLIBS)
plugin_native_dll: $(PLUGIN_NATIVE_DLL)
$(PLUGIN_NATIVE_DLL): $(PLUGIN_NATIVE_OBJS)
$(LD) $(LIBFLAGS) -o $(PLUGIN_NATIVE_DLL) $(PLUGIN_NATIVE_OBJS) $(JAVALIBS) $(XLIBS)
cp -f $(PLUGIN_NATIVE_DLL) libJVMPnatives_g.so
java:
@cd ../java; $(MAKE) all
host_prog: $(HOSTOBJS) $(HOSTPROG)
host_objs: $(HOSTOBJS)
$(HOSTPROG): $(HOSTOBJS)
$(CXX) -o $(HOSTPROG) $(HOSTOBJS) $(HOSTLIBS)
clean:
rm -f $(HOSTPROG) $(PLUGINOBJS) $(HOSTOBJS) core *.so *.o $(PRELOAD_HACK) plugin.policy
java_clean:
@cd ../java; $(MAKE) clean
ifeq ($(USE_SHM), 1)
plugin_exec: jvmp_exec
jvmp_exec: java_plugin_shm_host.o shmtran.o
$(CC) $(CFLAGS) -o jvmp_exec java_plugin_shm_host.o shmtran.o $(PLUGINLIBS)
else
plugin_exec:
endif
plugin.policy: ../../java/plugin.policy
@$(CP) -f ../../java/plugin.policy .
.PHONY: java clean all host_objs plugin_native_dll plugin_exec

View File

@@ -1,25 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: dump.sh,v 1.2 2001-07-12 19:57:39 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
tar czvf /tmp/jp.tgz /ws/M2308/mozilla/modules/jvmp/java/ /ws/M2308/mozilla/modules/jvmp/public/ /ws/M2308/mozilla/modules/jvmp/src/ /ws/M2308/mozilla/modules/jvmp/build/java/ /ws/M2308/mozilla/modules/jvmp/build/unix/GNUmakefile

View File

@@ -1,115 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: gtktest.c,v 1.2 2001-07-12 19:57:39 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
#include <gtk/gtk.h>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
void destroy( GtkWidget *widget,
gpointer data )
{
gtk_main_quit();
}
void my_exit() {
static int t=0;
fprintf(stderr, "My at exit called %d\n", t++);
}
int g_argc;
char** g_argv;
void* thread_func(void* arg) {
GtkWidget* window;
char* name = (char*) arg;
GtkWidget* button;
static int s = 0;
atexit(&my_exit);
if (s) {
return;
while (1) {usleep(100);}
putenv("DISPLAY=hercules:1");
};
s = 1;
/* gtk_init(&g_argc, &g_argv); */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (destroy), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
button = gtk_button_new_with_label (name);
/*
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (destroy), NULL);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (window));
*/
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_main_quit),
GTK_OBJECT (window));
gtk_container_add (GTK_CONTAINER (window), button);
gtk_widget_show (button);
gtk_widget_show (window);
gtk_main ();
return NULL;
}
int main(int argc, char** argv) {
pthread_t t[2];
void* res;
g_argc = argc;
g_argv = argv;
gtk_init(&g_argc, &g_argv);
atexit(&my_exit);
if (pthread_create(&(t[0]), NULL, thread_func, "Frame one") != 0) {
fprintf(stderr, "Cannot create first thread\n");
exit(1);
};
if (1 && pthread_create(&(t[1]), NULL, thread_func, "Frame two") != 0) {
fprintf(stderr, "Cannot create second thread\n");
exit(1);
};
pthread_join(t[0], &res);
pthread_join(t[1], &res);
/*while (1) {
usleep(100);
fprintf(stderr, ".");
};
*/
return 0;
}

View File

@@ -1,45 +0,0 @@
#!/bin/sh
WFHOME=`pwd`
# Customizable part
JVMTYPE=sun
#JVMTYPE=ibm
#JVM_KIND=hotspot
#JVM_KIND=classic
JVM_KIND=client
XTXMMIX=1
# End of customizable part
case "`uname -m`" in \
i[3-6]86) \
ARCH=i386 \
;; \
i86pc) \
ARCH=i386 \
;; \
sparc*) \
ARCH=sparc \
;; \
sun4u) \
ARCH=sparc \
;; \
*) \
ARCH=uname -m \
;; \
esac
# workaround for bug/feature in JDK - it resolving libjvm.so using
# dlopen("libjvm.so") - doesn't work if libjvm.so isn't in LD_LIBRARY_PATH
case $JVMTYPE in
sun)
LD_LIBRARY_PATH=${WFJDKHOME}/jre/lib/${ARCH}/${JVM_KIND}:${WFJDKHOME}/jre/lib/${ARCH}:${LD_LIBRARY_PATH}
;;
ibm)
LD_LIBRARY_PATH=${WFJDKHOME}/jre/bin/${JVM_KIND}:${WFJDKHOME}/jre/bin:${LD_LIBRARY_PATH}
;;
esac
if [ $XTXMMIX -eq 1 ]; then
# workaround for mixing of libXt.so and libXm.so in one application, if first
# loaded is libXt.so - as with Mozilla.
LD_PRELOAD=${WFHOME}/Helper.libXm.so.4
fi
export WFHOME LD_LIBRARY_PATH LD_PRELOAD

View File

@@ -1,79 +0,0 @@
#!/bin/csh -x
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: set_paths.csh,v 1.2 2001-07-12 19:57:41 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
setenv WFHOME `pwd`
# Customizable part
setenv JVMTYPE sun
#setenv JVMTYPE ibm
setenv JVM_KIND hotspot
#setenv JVM_KIND classic
setenv XTXMMIX 1
# End of customizable part
switch (`uname -m`)
case i[3-6]86:
setenv ARCH i386
breaksw
case i86pc:
setenv ARCH i386
breaksw
case sparc*:
setenv ARCH sparc
breaksw
case sun4u:
setenv ARCH sparc
breaksw
default:
setenv ARCH `uname -m`
endsw
if ($?LD_LIBRARY_PATH) then
# me such a stupid - how to use negation in C shell
else
setenv LD_LIBRARY_PATH ""
endif
# workaround for bug/feature in JDK - it resolving libjvm.so using
# dlopen("libjvm.so") - doesn't work if libjvm.so isn't in LD_LIBRARY_PATH
switch ($JVMTYPE)
case sun:
setenv LD_LIBRARY_PATH {$WFJDKHOME}/jre/lib/{$ARCH}/{$JVM_KIND}:{$WFJDKHOME}/jre/lib/{$ARCH}:{$LD_LIBRARY_PATH}
breaksw
case ibm:
setenv LD_LIBRARY_PATH $WFJDKHOME/jre/bin/$JVM_KIND:$WFJDKHOME/jre/bin/$ARCH:$LD_LIBRARY_PATH
breaksw
endsw
if ($XTXMMIX == 1) then
# workaround for mixing of libXt.so and libXm.so in one application, if first
# loaded is libXt.so - as with Mozilla.
setenv LD_PRELOAD $WFHOME/Helper.libXm.so.4
endif

View File

@@ -1,4 +0,0 @@
LIBRARY jvmp
EXPORTS
JVMP_GetPlugin @1

View File

@@ -1,190 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: makefile.win,v 1.2 2001-07-12 19:57:43 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
BUILDDIR=.
ROOTDIR=..\..
CC=cl
CXX=cl
CP=copy
DEL=del/f/q
DELTREE=del/S/Q/F
MKDIR=mkdir
ZIP=zip
LD = link
MAKE=nmake -nologo
# type of really used JVM
# values: _JVMP_IBMJVM, _JVMP_SUNJVM
#JVMTYPE = _JVMP_IBMJVM
JVMTYPE = _JVMP_SUNJVM
# kind of JVM: classic, hotspot
JVMKIND = hotspot
#JVMKIND = classic
THREADTYPE = _JVMP_WIN32THREADS
ARCH=win32
CCDEBUG = -MDd -Zi -Od
#CCDEBUG =
INCLUDES = -I$(ROOTDIR)\include -I..\..\public -I..\..\public\$(ARCH) -I$(WFJDKHOME)\include -I$(WFJDKHOME)\include\$(ARCH)
# XXX: hardcoded platform
EXTRA_CFLAGS = $(CCDEBUG) -D$(JVMTYPE) -D$(THREADTYPE) -DXP_WIN32 -DARCH="\"win32\"" -DWIN32 -DJVMKIND="\"$(JVMKIND)\"" -DPLATFORM="\"i386\""
CFLAGS = -nologo -DWIN32 $(PICFLAGS) $(EXTRA_CFLAGS) $(INCLUDES) -WX
CXXFLAGS = $(CFLAGS) -I$(HOSTINCPATH) -I$(HOSTINCPATH)\glib -I$(HOSTINCPATH)\gdk -DXP_WIN32
LIBFLAGS = -nologo -debug -incremental:NO
PLUGINCSRCDIR = ..\..\src\plugin
PLUGINMDDIR = ..\..\src\plugin\win32
PLUGINCSRCS = java_plugin.c jpthreads.c
# source of native methods for Plugin
PLUGINNATIVESRC = native.c
PLUGIN_DLL = jvmp.dll
# well, just a hack
PLUGIN_NATIVE_DLL=JVMPnatives.dll
# source of Mozilla-dependent module - should be separated
MOZEXTSRCDIR = ..\..\src\plugin\mozilla
MOZEXTCSRC = wfe_mozilla.c wfm6_native.c
MOZEXT_DLL = wf_moz6.dll
TESTEXTSRCDIR = ..\..\src\host
TESTEXTCSRC = test_extension.c
TESTEXT_DLL = wf_test.dll
HOSTCPPSRCDIR = ..\..\src\host
HOSTCPPSRCS = host.cpp
HOSTPROG=plugin_host.exe
PLUGINOBJS=$(PLUGINCSRCS:.c=.obj)
PLUGIN_NATIVE_OBJS=$(PLUGINNATIVESRC:.c=.obj)
HOSTOBJS=$(HOSTCPPSRCS:.cpp=.obj)
MOZEXTOBJS = $(MOZEXTCSRC:.c=.obj)
NCEXTOBJS = $(NCEXTCSRC:.c=.obj)
TESTEXTOBJS=$(TESTEXTCSRC:.c=.obj)
OBJDIR =
INSTALLER = installer.exe
INSTSRCDIR = ..\..\src\plugin\win32
INSTSRC = installer.c
INSTOBJS = $(INSTSRC:.c=.obj)
PLUGINLIBS=user32.lib
INSTLIBS=user32.lib
HOSTLIBS=$(HOSTLIBPATH)\glib-1.3.lib $(HOSTLIBPATH)\gtk-1.3.lib $(HOSTLIBPATH)\gdk-1.3.lib
#instead of vpath
{$(PLUGINCSRCDIR)}.c{$(OBJDIR)}.obj:
@$(CC) $(CFLAGS) -D_JVMP_IMPLEMENTATION -c -Fo$@ $<
{$(PLUGINMDDIR)}.c{$(OBJDIR)}.obj:
@$(CC) $(CFLAGS) -D_JVMP_IMPLEMENTATION -c -Fo$@ $<
{$(HOSTCPPSRCDIR)}.cpp{$(OBJDIR)}.obj:
@$(CXX) $(CXXFLAGS) -c -Fo$@ $<
{$(MOZEXTSRCDIR)}.c{$(OBJDIR)}.obj:
@$(CC) $(CFLAGS) -c -Fo$@ $<
{$(TESTEXTSRCDIR)}.c{$(OBJDIR)}.obj:
@$(CC) $(CFLAGS) -c -Fo$@ $<
{$(INSTSRCDIR)}.c{$(OBJDIR)}.obj:
@$(CC) $(CFLAGS) -c -Fo$@ $<
all: makefile.win ext plugin
release: all
@ cd ..\java
@ $(MAKE) -fmakefile.win release
@ cd ..\win32
-@ $(DELTREE) wfrelease > NUL
@ IF NOT EXIST wfrelease $(MKDIR) wfrelease
@ IF NOT EXIST wfrelease\ext $(MKDIR) wfrelease\ext
@ $(CP) wf.jar wfrelease > NUL
@ $(CP) $(PLUGIN_DLL) wfrelease > NUL
@ $(CP) $(MOZEXT_DLL) wfrelease > NUL
@ $(CP) $(PLUGIN_NATIVE_DLL) wfrelease > NUL
@ $(CP) plugin.policy wfrelease > NUL
@ $(CP) ext\*.jar wfrelease\ext > NUL
@ $(ZIP) -r wf-bin.zip wfrelease
@ echo "Release is wf-bin.zip"
.SUFFIXES:
.SUFFIXES: .cpp .c .obj
.cpp.obj:
$(CXX) $(CFLAGS) -c $<
plugin_no_java: plugin_objs plugin_dll plugin_native_dll plugin_exec plugin.policy $(INSTALLER)
plugin: plugin_no_java java_classes
plugin_objs: $(PLUGINOBJS) $(PLUGIN_NATIVE_OBJS)
plugin_dll: $(PLUGIN_DLL)
ext: $(MOZEXT_DLL) $(TESTEXT_DLL)
$(MOZEXT_DLL): $(MOZEXTOBJS)
@echo linking $@
@$(LD) $(LIBFLAGS) -dll -def:wfe_mozilla.def -out:$@ $(MOZEXTOBJS)
$(TESTEXT_DLL): $(TESTEXTOBJS)
@echo linking $@
@$(LD) $(LIBFLAGS) -dll -def:wfe_test.def -out:$(TESTEXT_DLL) $(TESTEXTOBJS)
$(PLUGIN_DLL): $(PLUGINOBJS)
@echo linking $@
@$(LD) $(LIBFLAGS) -dll -def:jvmp.def -out:$@ $(PLUGINOBJS) $(PLUGINLIBS)
plugin_native_dll: $(PLUGIN_NATIVE_DLL)
$(PLUGIN_NATIVE_DLL): $(PLUGIN_NATIVE_OBJS)
@echo linking $@
@$(LD) $(LIBFLAGS) -dll -out:$@ $(PLUGIN_NATIVE_OBJS)
@$(CP) $@ JVMPnatives_g.dll > NUL
plugin.policy: ..\..\java\plugin.policy
@$(CP) ..\..\java\plugin.policy . > NUL
java_classes:
@ echo Making Java classes
@ cd ..\java
@$(MAKE) -fmakefile.win all
host_prog: $(HOSTOBJS) $(HOSTPROG)
host_objs: $(HOSTOBJS)
$(HOSTPROG): $(HOSTOBJS)
@echo linking $@
@$(LD) $(LIBFLAGS) -out:$(HOSTPROG) $(HOSTOBJS) $(HOSTLIBS)
clean:
@echo Removing compiled files..
@-del/Q $(PLUGINOBJS) $(HOSTOBJS) *.exe *.dll *.obj
@cd ..\java
@$(MAKE) -fmakefile.win clean
$(INSTALLER): $(INSTOBJS)
@echo Linking installer
@$(LD) $(LIBFLAGS) -out:$(INSTALLER) $(INSTOBJS) $(INSTLIBS)
plugin_exec:
.PHONY: java_classes clean all host_objs plugin_native_dll plugin_exec release

View File

@@ -1,30 +0,0 @@
@REM
@REM The contents of this file are subject to the Mozilla Public
@REM License Version 1.1 (the "License"); you may not use this file
@REM except in compliance with the License. You may obtain a copy of
@REM the License at http://www.mozilla.org/MPL/
@REM
@REM Software distributed under the License is distributed on an "AS
@REM IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
@REM implied. See the License for the specific language governing
@REM rights and limitations under the License.
@REM
@REM The Original Code is The Waterfall Java Plugin Module
@REM
@REM The Initial Developer of the Original Code is Sun Microsystems Inc
@REM Portions created by Sun Microsystems Inc are Copyright (C) 2001
@REM All Rights Reserved.
@REM
@REM $Id: set_env.bat,v 1.2 2001-07-12 19:57:43 edburns%acm.org Exp $
@REM
@REM Contributor(s):
@REM
@REM Nikolay N. Igotti <nikolay.igotti@Sun.Com>
@REM
@echo off
echo Setting some variables for WF....
set WFJDKHOME=c:\jdk1.3
set HOSTINCPATH=d:\inn\libs\include
set HOSTLIBPATH=d:\inn\libs\lib
set PATH=%HOSTLIBPATH%;%PATH%

View File

@@ -1,9 +0,0 @@
LIBRARY wf_moz6
EXPORTS
JVMP_GetExtension
Java_sun_jvmp_mozilla_MozillaAppletPeer_getParams
Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeShowDocument
Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeShowStatus

View File

@@ -1,6 +0,0 @@
LIBRARY wf_test
EXPORTS
JVMP_GetExtension

View File

@@ -1,13 +0,0 @@
Mon Apr 2 16:43:40 2001:
Started ChangeLog.
Major clean up of build system
No more jni.h, jni_md.h in Waterfall tree
Added "release" target to makefile - allows binary-only release bundling
Waterfall classes now in JAR
Thu Apr 26 02:48:51 2001:
Minor build system updates.
Fixed crashers on Solaris by simple
reordering of some entries in LD_LIBRARY_PATH.
Added support for x86 Solaris, but it sometimes crashes -
almost sure not Waterfall fault.

View File

@@ -1,16 +0,0 @@
The contents of this file are subject to the Mozilla Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is The Waterfall Java Plugin Module
The Initial Developer of the Original Code is Sun Microsystems Inc
Portions created by Sun Microsystems Inc are Copyright (C) 2001
All Rights Reserved.

View File

@@ -1,17 +0,0 @@
1. Netscape 4 build is broken, as I see no reasons to work on it (very tight
in time).
If someone wishes to do it - please note that on Unix you need to run JVM
in separate process. It's bad for speed. Also you need to complete remote
bridge shmtran.[ch] as it shouldn't work for calls like
NC->Java->NC for now. It's not too hard, you just need to poll on proper
SHM queue
when waiting for completion of the call, and if something has come -
process it.
2. Rewrite code borrowed from Java Plugin and remove dead code.
3. Add handler for access to browser-provided protocols from applets
(most obvious HTTPS).
4. Complete Waterfall own security model - maybe just get rid of capabilies
at all, if I'll see no use of it.

View File

@@ -1,102 +0,0 @@
#!/usr/bin/perl
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: add_legal.pl,v 1.1 2001-07-12 20:25:38 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
require "rules.pl";
$relpath = "";
sub get_type
{
my ($name) = @_;
foreach (keys %mapping)
{
return $mapping{$_} if ($name =~ /$_/);
}
return undef;
}
sub handle_file
{
my ($file, $name) = @_;
my $type = get_type($name);
open(FILE, $file) || die "cannot read $file: $!";
#print "name=$name type=$type\n";
my @lines = <FILE>;
close(FILE);
my @newlines;
if ($type) {
my ($pre, $com1, $com2, $com3) =
($prefixes{$type}, $comments_start{$type},
$comments_middle{$type}, $comments_end{$type});
if (!$com1 || !com2 || !com3) {
print "not defined comments for type $type - skipping...\n";
@newlines = @lines;
} else {
@newlines = proceed($file, $type, @lines);
}
} else {
print "skipped $file...\n";
@newlines = @lines;
}
my $newname = "$newtree/$relpath$name";
open(FILE, ">$newname") || die "cannot write to $newname: $!"; ;
foreach (@newlines) {
print FILE $_;
}
close(FILE);
}
sub handle_dir
{
my ($dir, $short) = @_;
my $oldrelpath = $relpath;
$relpath .= $short."/" if ($short);
opendir(DIR, $dir) || die "can't opendir $dir: $!";
my $newdir = "$newtree/$relpath";
mkdir $newdir unless (-d $newdir);
# it will remove all starting with dot entries
my @entries = grep { !/^\.$/ && !/^\.\.$/} readdir(DIR);
closedir DIR;
my @filez = grep { -f "$dir/$_"} @entries;
foreach (@filez) { handle_file("$dir/$_", $_); }
my @dirz = grep { -d "$dir/$_" && !$ignore_dirs{$_}} @entries;
foreach (@dirz) {
print "Handling $relpath$_...\n";
handle_dir("$dir/$_", $_);
}
$relpath = $oldrelpath;
}
open(LIC, $license) || die "can't read license file $license: $!";
@lic = <LIC>;
close (LIC);
handle_dir($oldtree, "");

View File

@@ -1,54 +0,0 @@
How to build Waterfall:
Requirments:
Linux/Solaris:
gcc, pthreads, JDK1.3, LessTif/Motif headers only
glib, gtk+ - only for test program, not used in Waterfall
Win32:
Visual C++ 5.0, 6.0, JDK1.3
glib, gtk+ - only for test program -
can be found at http://user.sgic.fi/~tml/gimp/win32/
Build, run:
Linux/Solaris:
- get CVS tree
- cd build/unix
- export/setenv WFJDKHOME=<path to JDK1.3 to be used by Waterfall>
- edit Defs.gmk to select desired JVM type/vendor (default is Sun Hotspot
JVM)
- gmake
- edit set_path script according to selected JVM type/vendor
- source ./set_path
- ./plugin_host - runs test program
It allows
- to start/stop JVM, stop hangs up program, as not implemented by JDK
- obtain capabilities (required to perform other actions)
- show/hide Java console
- get Waterfall module description
- load test extension and interact with it
- register native window and test it using test extension
- test Java/native thread interaction
Win32:
- get CVS tree
- set WFJDKHOME=<path to JDK1.3 to be used by Waterfall>
- cd build\win32
- edit makefile.win to select desired JVM type/vendor(default is Sun
Hotspot JVM)
- if you wish to build test program
- make folder for GTK/GDK libs
- mkdir include and copy GTK/GDK/GLIB headers there
- mkdir lib and copy GTK/GDK/GLIB libs there
- set env variables HOSTINCPATH and HOSTLIBPATH pointing on include and lib respectively
- type nmake -f makefile.win host_prog
- nmake -f makefile.win
- set WFHOME=<path to current directory>
- plugin_host.exe - runs test program
- to start/stop JVM, stop hangs up program, as not implemented by JDK
- obtain capabilities (required to perform other actions)
- show/hide Java console
- get Waterfall module description
- load test extension and interact with it
- register native window and test it using test extension
- test Java/native thread interaction - not yet implemented
on Win32

View File

@@ -1,15 +0,0 @@
Copyright issues with Waterfall.
COPYRIGTH POLICY:
Waterfall intended to be GPL'ed, or maybe MPL'ed.
DEPENDNCIES:
This product was inspired by Java Plugin (and designed to replace it)
so I used some of Java Plugin code. Code itself is licensed under Sun's JDK
license. So to obtain clean GPL'ed implementation we need:
- rewrite applet viewer (sun/jvmp/applet)
- rewrite Java LiveConnect related code in Mozilla extension (C code is clean)
but Mozilla extension isn't official part of Waterfall.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -1,28 +0,0 @@
<HTML>
<HEAD>
<TITLE>Introduction to Waterfall</TITLE>
</HEAD>
<BODY>
<PRE>
This document describes the benefits of waterfall.
This diagram illustrates the allocation of dependencies to dlls in both
the Java Plugin (JPI) and waterfall.
<IMG SRC="wf_deployment.gif"></IMG>
You can see from the above diagram that all the browser specific
dependencies are located in the wf_moz6.dll. wf_moz6.dll communicates
to the jvmp.dll through the well defined waterfall C api. jvmp.dll
communicates to the Java environment through the well defined JNI C api.
<IMG SRC="jpi_deployment.gif"></IMG>
The Java Plugin has browser specific dependencies in both npoji600.dll
and in jpins32.dll. jpins32.dll communicates with the Java environment
throug the well defined JNI C api and some additional proprietary APIs.
Thus, a change in any of the netscape interfaces impacts the java plugin
very deeply, where with waterfall, the change is isolated to one module.
</PRE> </BODY> </HTML>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -1,303 +0,0 @@
<HTML>
<HEAD>
<TITLE>Reasearch Scratch Pad for Learning Waterfall</TITLE>
</HEAD>
<BODY>
<PRE>
This document is a scratch pad for helping me understand how waterfall
works. I will use mozilla and the debugger as a guide. I'll start by
discovering how mozilla hooks into waterfall.
Refer to this diagram:
<IMG SRC="primaryclasses.gif"></IMG>
Waterfall Metrics
=================
144 files total
76 java
3 cpp
25 c
40 h
30849 SLOC including comments.
Waterfall Bootstrapping
=======================
Mozilla hooks in to waterfall by virtue of the wf_moz6 module being an
XPCOM component.
D:\Projects\trunk\mozilla\wf_moz6\wf_moz6\src\nsCJVMFactory.cpp
This file defines the necessary macro to be an XPCOM component:
NS_IMPL_NSGETMODULE("nsCJVMModule", components);
The second argument is an array of nsModuleComponentInfo structs.
static nsModuleComponentInfo components[] =
{
{ "Waterfall API-based JVM Service",
NS_PLUGGABLEJVM_CID,
NS_INLINE_PLUGIN_CONTRACTID_PREFIX "application/x-java-vm",
nsJavaHTMLObjectFactory::Create,
},
};
nsModuleComponentInfo is defined in:
D:\Projects\trunk\mozilla\dist\include\nsIGenericFactory.h
The important elements in this struct are the third and forth:
const char* mContractID;
NSConstructorProcPtr mConstructor;
the mContractID tells XPCOM what our programmatic name is, and the
mConstructor tells XPCOM what to call to construct an instance of the
module. In waterfall's case, this is nsJavaHTMLObjectFactory::Create,
defined in
D:\Projects\trunk\mozilla\wf_moz6\wf_moz6\src\nsJavaHTMLObjectFactory.cpp
As you may know every dll in the components directory is interrogated at
mozilla startup in what is known as "auto-registration". This is how
waterfall gets picked up. The waterfall library is called
dist\win32*\bin\components\ojijvm.dll. Our Create method gets called
here:
nsJavaHTMLObjectFactory::Create(nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012f8e4) line 92
nsGenericFactory::CreateInstance(nsGenericFactory * const 0x0173a2d0, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012f8e4) line 56
nsComponentManagerImpl::CreateInstance(nsComponentManagerImpl * const 0x00a96c80, const nsID & {...}, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012f8e4) line 1199 + 24 bytes
nsComponentManager::CreateInstance(const nsID & {...}, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012f8e4) line 82
nsServiceManagerImpl::GetService(nsServiceManagerImpl * const 0x00a955a0, const nsID & {...}, const nsID & {...}, nsISupports * * 0x0012f9a4, nsIShutdownListener * 0x00000000) line 344 + 19 bytes
nsServiceManagerImpl::GetService(nsServiceManagerImpl * const 0x00a955a0, const char * 0x024536d0, const nsID & {...}, nsISupports * * 0x0012f9a4, nsIShutdownListener * 0x00000000) line 492
nsServiceManager::GetService(const char * 0x024536d0, const nsID & {...}, nsISupports * * 0x0012f9a4, nsIShutdownListener * 0x00000000) line 605
nsGetServiceByContractID::operator()(const nsID & {...}, void * * 0x0012f9a4) line 64 + 22 bytes
nsCOMPtr<nsIPlugin>::assign_from_helper(const nsCOMPtr_helper & {...}, const nsID & {...}) line 970 + 18 bytes
nsCOMPtr<nsIPlugin>::nsCOMPtr<nsIPlugin>(const nsCOMPtr_helper & {...}) line 552
nsJVMManager::StartupJVM() line 605 + 30 bytes
nsJVMManager::MaybeStartupLiveConnect() line 788 + 20 bytes
nsJVMManager::StartupLiveConnect(nsJVMManager * const 0x01739118, JSRuntime * 0x00f97210, int & 0) line 128 + 11 bytes
nsJSEnvironment::nsJSEnvironment() line 1505 + 49 bytes
nsJSEnvironment::GetScriptingEnvironment() line 1446 + 27 bytes
NS_CreateScriptContext(nsIScriptGlobalObject * 0x0169c7b0, nsIScriptContext * * 0x01693680) line 1545 + 5 bytes
nsDocShell::EnsureScriptEnvironment(nsDocShell * const 0x016935d0) line 4384 + 50 bytes
nsWebShell::GetInterface(nsWebShell * const 0x016935f4, const nsID & {...}, void * * 0x0012fc00) line 327 + 19 bytes
nsGetInterface::operator()(const nsID & {...}, void * * 0x0012fc00) line 37 + 31 bytes
nsCOMPtr<nsIDOMWindowInternal>::assign_from_helper(const nsCOMPtr_helper & {...}, const nsID & {...}) line 970 + 18 bytes
nsCOMPtr<nsIDOMWindowInternal>::nsCOMPtr<nsIDOMWindowInternal>(const nsCOMPtr_helper & {...}) line 552
nsAppShellService::GetHiddenWindowAndJSContext(nsAppShellService * const 0x00b579b0, nsIDOMWindowInternal * * 0x0012fca8, JSContext * * 0x0012fcac) line 727 + 32 bytes
nsAppShellService::SetXPConnectSafeContext() line 191 + 40 bytes
nsAppShellService::CreateHiddenWindow(nsAppShellService * const 0x00b579b0) line 251
main1(int 1, char * * 0x00a95930, nsISupports * 0x00000000) line 987
main(int 1, char * * 0x00a95930) line 1298 + 37 bytes
mainCRTStartup() line 338 + 17 bytes
KERNEL32! 77f1ba3c()
Regarding nsJVMManager.cpp StartupJVM() on the stack: this is where the
first modification in the patch to bug 72708 comes into play:
NS_WITH_SERVICE(nsIPlugin, f,
NS_INLINE_PLUGIN_CONTRACTID_PREFIX NS_JVM_MIME_TYPE,
&err);
if (NS_FAILED(err) || !f) {
err = pluginHost->GetPluginFactory(NS_JVM_MIME_TYPE, &pluginFactory);
}
else {
pluginFactory = f;
}
Note that the contract ID matches the one specified in
nsCJVMFactory.cpp. Here Nikolay has modified the oji code to first
check for waterfall, then to fall back on the
pluginHost->CreatePlugin().
ns nsJavaHTMLObjectFactory::Create, we create an instance of
nsJavaHTMLObjectFactory. This has a reference to an nsIPluggableJVM
impl. We send nsJavaHTMLObjectFactory Initialize(). In Initialize(),
we send StartupJVM to nsIPluggableJVM. This calls
nsPluggableJVM::loadPluginDLL(). As far as I can tell this is where the
first call into the Waterfall plugin code occurrs. loadPluginDLL() opens
the jvmp.dll, and finds the symbol "JVMP_GetPlugin". This calls
loadJVM(), which opens the JDK's JVM dll and looks for several symbols.
Here there is ifdef'd code for each of the supported JVMS:
#ifdef _JVMP_IBMJVM
#ifdef _JVMP_SUNJVM
etc.
The symbols loaded from the JVM dll are:
JNI_GetDefaultJavaVMInitArgs
JNI_CreateJavaVM
JNI_GetCreatedJavaVMs
JVMP_GetPlugin returns a pointer to a static JVMP_RuntimeContext
instance. JVMP_RuntimeContext is defined in
d:\Projects\blackwood\eng\wf\public\jvmp.h. The RuntimeContext is a
collection pointers to functions defined in java_plugin.c.
nsPluggableJVM keeps a pointer to the JVMP_RuntimeContext.
After loading the jvmp.dll, we call nsPluggableJVM::initJVM().
nsPluggableJVM::initJVM() calls JVMP_GetRunningJVM(), in
d:\Projects\blackwood\eng\wf\src\plugin\java_plugin.c. This calls
JVMP_initJavaClasses(). Here is the first time we see JNI constructs.
We find the class sun/jvmp/generic/{motif,win32}/Plugin.java and call its
startJVM() method. This returns an instance of the java class
PluggableJVM. This is saved as the static native var
JVMP_PluginInstance. The class Plugin is saved as JVMP_PluginClass.
After returning, we call JVMP_initClassPath, which pulls in the java
classpath from the CLASSPATH env var. This results in creating an array
like this:
Java Plugin: JVM option[0]=-Djava.class.path=D:\Projects\blackwood\eng\wf\build\win32\classes;
Java Plugin: JVM option[1]=-Djava.library.path=D:\Projects\blackwood\eng\wf\build\win32;D:\Projects\blackwood\eng\wf\build\win32\java\jre\lib\win32:
Java Plugin: JVM option[2]=-Djava.home=D:\Projects\blackwood\eng\wf\build\win32/java/jre
Java Plugin: JVM option[3]=-Xbootclasspath:D:\Projects\blackwood\eng\wf\build\win32\java\jre\classes;D:\Projects\blackwood\eng\wf\build\win32\java\jre\lib\rt.jar;D:\Projects\blackwood\eng\wf\build\win32\java\jre\lib\i18n.jar
Java Plugin: JVM option[4]=-Djava.security.manager
Java Plugin: JVM option[5]=-Djvmp.home=D:\Projects\blackwood\eng\wf\build\win32
Java Plugin: JVM option[6]=-Djava.security.policy=file:D:/Projects/blackwood/eng/wf/build/win32/plugin.policy
We then try to get access to a JavaVM, using JVMP_ReuseJVM(). This uses
the JVMMethods struct, defined in java_plugin.c. This is a struct of
function pointers to JVM methods.
We then call JVMP_EnableCapabilities(). This is the first sign of
security code in waterfall. Let me step out of context to define two
terms. A Principal is an entity responsible for a script in some way.
There are several kinds of principals. A certificate principal
represents the signer of the script. A certificate principal is
responsible for proving the script is from who it says it is. Another
way of saying it is that a certificate principal is responsible for the
script's authentication. The set of principals is fixed at the time the
page is loaded. Each principal has a set of capabilities, each of which
can be enabled or disabled by the system and the user.
I don't know what a system principal is, but it represents mozilla.org?
How does a codebase principal differ from a certificate principal? They
both seem to deal with the issue of authentication.
Back to calling JVMP_EnableCapabilities(). This manipulates the
JVMP_CallingContext, a struct with function pointers for manipulating
Caps. Caps is a term bandied about by security types. It's short for
capabilities. If someone could come up with a better definition, I'd
appreciate it. At this point we call back into java for the
PluggableJVM.enableCapabilities() method, passing in the byte array for
the caps and an array of principals.
We return and pop up the java console, then return from
nsJavaHTMLObjectFactory::Create(), returning an instance of
nsJavaHTMLObjectFactory typed as a nsIPlugin. Our being typed this way
enables us to provide the necessary services to the browser. This
completes the bootstrapping process.
How an Applet is instantiated
=============================
The normal plugin instantiation and initialization proccess occurrs.
This includes scanning the plugin directory for any plugins that respond
to the applet mime type. Of course none are found since waterfall
requires that the java plugin is not installed. Then we try to
instantiate a plugin using the contract id:
"@mozilla.org/inline-plugin/application/x-java-vm". Remember that
waterfall declared itself as responding to that contractID in
D:\Projects\trunk\mozilla\wf_moz6\wf_moz6\src\nsCJVMFactory.cpp. This
happens here:
nsJavaHTMLObjectFactory::Create(nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012a944) line 104
nsGenericFactory::CreateInstance(nsGenericFactory * const 0x0173beb0, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012a944) line 56
nsComponentManagerImpl::CreateInstance(nsComponentManagerImpl * const 0x00a96bc0, const nsID & {...}, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012a944) line 1199 + 24 bytes
nsComponentManagerImpl::CreateInstanceByContractID(nsComponentManagerImpl * const 0x00a96bc0, const char * 0x0012a948, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012a944) line 1239
nsComponentManager::CreateInstance(const char * 0x0012a948, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012a944) line 94
nsPluginHostImpl::SetUpPluginInstance(nsPluginHostImpl * const 0x0173a4b4, const char * 0x0b7d21ec, nsIURI * 0x0e0e6440, nsIPluginInstanceOwner * 0x0e0e6950) line 2758 + 28 bytes
nsPluginHostImpl::InstantiateEmbededPlugin(nsPluginHostImpl * const 0x0173a4b4, const char * 0x0b7d21ec, nsIURI * 0x0e0e6440, nsIPluginInstanceOwner * 0x0e0e6950) line 2461 + 24 bytes
nsObjectFrame::InstantiatePlugin(nsIPresContext * 0x0d0a3290, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, nsIPluginHost * 0x0173a4b4, const char * 0x0b7d21ec, nsIURI * 0x0e0e6440) line 1037
nsObjectFrame::Reflow(nsObjectFrame * const 0x0125596c, nsIPresContext * 0x0d0a3290, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, unsigned int & 0) line 853 + 49 bytes
The plugin is looking for an nsIPluginInstance instance, which waterfall
returns in the form of an nsAppletHTMLObject instance. This guy also
implements nsIJVMPluginInstance. It creates and has a nsIJavaHTMLObject
instance. According to the comments, the nsIJavaHTMLObject instance is
the "is instance of visible object on browser's page controlled by Java
code, like APPLET or OBJECT tag content." This eventually calls into
the java class PluggableJVM.createPeer(). The nsIJavaHTMLObject
instance creates and keeps an nsIJavaObjectInfo instance.
Comments and Questions
======================
How does the java console get hooked up to nsIJVMConsole?
nsJavaHTMLObjectFactory::Initialize()
should use do_getService() instead of nsServiceManager::GetService().
shouldn't use stock malloc, should use nsCRT.
nsPluggableJVM::StartupJVM()
shouldn't use env vars. At the very least, shouldn't use stock
getenv, should use nsCRT.
Console shouldn't be hard coded to visible.
JVMP_initClassPath(), JVMP_GetPlugin(), loadJVM(), etc
I know these classes are independent of mozilla. Is it ok to use the
stock malloc() and getenv()? Should waterfall c plugin classes use
nspr?
Is this ifdefing allowable:
#ifdef _JVMP_IBMJVM
#ifdef _JVMP_SUNJVM
In loadJVM() we have the filepaths to the jvm dll hard coded, is this
safe?
Is it safe to assume these symbols are in the jvm dll?
JNI_GetDefaultJavaVMInitArgs
JNI_CreateJavaVM
JNI_GetCreatedJavaVMs
Or do we assume we'll have a different jvmp for each released Java
plugin version? I *do* think this is a safe assumption.
* JRE 1.3.0_01 doesn't have classic vm
* when running ./plugin_host, you must start the JVM, then enable system
capabilities in order to do most anything else.
* He has inconsistent environment variables for things.
JAVA_HOME == JDK
* The documentation refers to files that aren't there. build.txt refers
to ../java/makefile.win, when it should be ../build/java/makefile.win.
* Why do you have to copy the Java directory into the build area on
win32, and link it on unix?
* Why does he have a jni.h in his tree? How does it differ from the
stock jni.h?
* Building is a mess. Each platform has unnecessarily different
conventions, many errors in build instructions.
* Can't build wf_moz6: Syntax errors.
</PRE>
</BODY>
</HTML>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -1,76 +0,0 @@
<?xml version = "1.0" encoding = "ISO-8859-1" ?>
<!DOCTYPE argo SYSTEM "argo.dtd" >
<argo>
<documentation>
<authorname></authorname>
<version></version>
<description>
</description>
</documentation>
<searchpath href="PROJECT_DIR" />
<member
type="pgml"
name="wf_classdiagram1.pgml"
/>
<member
type="pgml"
name="wf_usecasediagram1.pgml"
/>
<member
type="xmi"
name="wf.xmi"
/>
<member
type="pgml"
name="wf_classdiagram3.pgml"
/>
<historyfile name="" />
<stats>
<stat name="clicksInToDoPane"
value="0" />
<stat name="dblClicksInToDoPane"
value="0" />
<stat name="longestToDoList"
value="206" />
<stat name="longestAdd"
value="0" />
<stat name="longestHot"
value="0" />
<stat name="numCriticsFired"
value="47595" />
<stat name="numNotValid"
value="0" />
<stat name="numCriticsApplied"
value="0" />
<stat name="toDoPerspectivesChanged"
value="0" />
<stat name="navPerspectivesChanged"
value="2" />
<stat name="clicksInNavPane"
value="0" />
<stat name="numFinds"
value="0" />
<stat name="numJumpToRelated"
value="0" />
<stat name="numDecisionModel"
value="0" />
<stat name="numGoalsModel"
value="0" />
<stat name="numCriticBrowser"
value="0" />
<stat name="numNavConfig"
value="0" />
<stat name="numHushes"
value="0" />
<stat name="numChecks"
value="0" />
<stat name="Num_Button_Clicks"
value="0" />
<stat name="Drags_To_New"
value="0" />
<stat name="Drags_To_Existing"
value="0" />
</stats>
</argo>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE pgml SYSTEM "pgml.dtd">
<pgml description="uci.uml.visual.UMLUseCaseDiagram|-64--127-100-3-40a9f9:e56db40b1d:-8000"
name="use case diagram 1"
>
</pgml>

View File

@@ -1,159 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is The Waterfall Java Plugin Module
#
# The Initial Developer of the Original Code is Sun Microsystems Inc
# Portions created by Sun Microsystems Inc are Copyright (C) 2001
# All Rights Reserved.
#
# $Id: rules.pl,v 1.1 2001-07-12 20:25:40 edburns%acm.org Exp $
#
# Contributor(s):
#
# Nikolay N. Igotti <nikolay.igotti@Sun.Com>
#
$post_license = <<EOF
Contributor(s):
Nikolay N. Igotti <nikolay.igotti\@Sun.Com>
EOF
;
# trick to prevent CVS from rewriting those comments
$post_license = "\$"."Id: CVS comments placeholder "."Exp \$\n".$post_license;
$license = "/work/checkin/MPL.txt";
$oldtree = "/work/checkin/wf";
$newtree = "/work/checkin/wf.new";
%mapping = (
".*\\.cpp\$" => "cpp",
".*\\.c\$" => "c",
".*\\.h\$" => "h",
".*\\.java\$" => "java",
".*\\.bat\$" => "bat",
".*\\.BAT\$" => "bat",
".*\\.policy" => "policy",
".*\\.sh" => "sh",
".*\\.csh" => "csh",
"GNUmakefile" => "GNUmakefile",
"Makefile" => "Makefile",
"makefile\\.win" => "makefile.win",
".*\\.mk" => "mk",
".*\\.gmk" => "gmk",
".*\\.pl" => "pl"
);
%prefixes = (
"cpp" => "-*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ",
"c" => "-*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-",
"java" => "-*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-",
"h" => "-*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-"
);
%comments_start = (
"cpp" => "/* ",
"c" => "/* ",
"h" => "/* ",
"policy" => "/* ",
"sh" => "# ",
"csh" => "# ",
"pl" => "# ",
"GNUmakefile" => "# ",
"Makefile" => "# ",
"makefile.win"=> "# ",
"java" => "/* ",
"bat" => "\@REM ",
"BAT" => "\@REM ",
"mk" => "# ",
"gmk" => "# "
);
%comments_middle = (
"cpp" => " * ",
"c" => " * ",
"h" => " * ",
"policy" => " * ",
"java" => " * ",
"sh" => "# ",
"csh" => "# ",
"pl" => "# ",
"GNUmakefile" => "# ",
"Makefile" => "# ",
"makefile.win"=> "# ",
"mk" => "# ",
"gmk" => "# ",
"bat" => "\@REM ",
"BAT" => "\@REM "
);
%comments_end = (
"cpp" => " */",
"c" => " */",
"h" => " */",
"policy" => " */",
"sh" => "# ",
"csh" => "# ",
"pl" => "# ",
"GNUmakefile" => "# ",
"Makefile" => "# ",
"makefile.win"=> "# ",
"java" => " */ ",
"bat" => "\@REM ",
"BAT" => "\@REM ",
"mk" => "# ",
"gmk" => "# "
);
%ignore_dirs = (
"CVS" => 1
);
# filtering procedure:
# input - filename, type, list of file strings
# output - list of file strings
sub proceed
{
my ($file, $type, @lines) = @_;
my @newlines;
my ($pre, $com1, $com2, $com3) =
($prefixes{$type}, $comments_start{$type},
$comments_middle{$type}, $comments_end{$type});
# in shell scripts add only after #!<smth> execution comment
if ($type eq "sh" || $type eq "csh" || $type eq "pl") {
$_ = $lines[0];
push @newlines, shift @lines if (/^\#\S*\!/);
}
push @newlines, "$com1$pre\n";
push @newlines, "$com2\n" if ($pre);
foreach (@lic) {
push @newlines, "$com2$_";
}
my @post = split('\n', $post_license);
foreach (@post) {
push @newlines, "$com2$_\n";
}
push @newlines, "$com3\n\n";
foreach (@lines) {
push @newlines, $_;
}
return @newlines;
}

View File

@@ -1 +0,0 @@
‰PNG

View File

@@ -1 +0,0 @@
‰PNG

View File

@@ -1,30 +0,0 @@
Here follows short description of building and running Waterfall binaries
with Mozilla web browser.
Unix (Solaris, Linux)
1. export/setenv WFJDKHOME='JDK_1_3_directory'
2. checkout wf_moz6 CVS module
3. put resulting wf_moz6 directory to $(MOZILLA)/modules
4. cd $(MOZILLA)/modules/wf_moz6
5. edit src/Makefile.in and set WF variable to point to the
top of WF tree (I hope you already checkouted and built WF tree,
if not - read building.txt).
6. gmake
7. pushd $(WF)/build/unix; source set_paths; popd
8. run Mozilla from the same command line prompt
Windows
1. set WFJDKHOME='JDK_1_3_directory'
2. checkout wf_moz6 CVS module
3. put resulting wf_moz6 directory to $(MOZILLA)\modules
4. cd $(MOZILLA)\modules\wf_moz6
5. edit src\makefile.win and set WF variable to point to the
top of WF tree (I hope you already checkouted and built WF tree,
if not - read building.txt).
6. make -fmakefile.win
7. set WFHOME=$(WF)\build\win32
8. run Mozilla

View File

@@ -1,64 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: awt_Plugin.h,v 1.2 2001-07-12 19:57:44 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
/*
* @(#)awt_Plugin.h 1.5 00/05/04
*
* Copyright 2000 Sun Microsystems, Inc. All rights reserved.
* Copyright 2000 Sun Microsystems, Inc. Tous droits réservés.
*
* This software is the proprietary information of Sun Microsystems, Inc.
* Use is subject to license terms.
*/
/*
* Fix 4221246: Export functions for Netscape to use to get AWT info
*/
#ifndef _AWT_PLUGIN_H_
#define _AWT_PLUGIN_H_
#include <jni.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
void getAwtLockFunctions(void (**AwtLock)(JNIEnv *),
void (**AwtUnlock)(JNIEnv *),
void (**AwtNoFlushUnlock)(JNIEnv *),
void *);
void getExtAwtData(Display *,
int,
int *, /* awt_depth */
Colormap *, /* awt_cmap */
Visual **, /* awt_visInfo.visual */
int *, /* awt_num_colors */
void *);
void getAwtData(int *, Colormap *, Visual **, int *, void *);
Display *getAwtDisplay(void);
#endif /* _AWT_PLUGIN_H_ */

View File

@@ -1,46 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: sun_jvmp_generic_motif_Plugin.h,v 1.2 2001-07-12 19:57:44 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class sun_plugin_generic_motif_Plugin */
#ifndef _Included_sun_jvmp_generic_motif_Plugin
#define _Included_sun_jvmp_generic_motif_Plugin
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: sun_jvmp_generic_motif_Plugin
* Method: getWidget
* Signature: (IIIII)I
*/
JNIEXPORT jlong JNICALL Java_sun_jvmp_generic_motif_Plugin_getWidget
(JNIEnv *, jclass, jint, jint, jint, jint, jint);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,94 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: sun_jvmp_generic_motif_PthreadSynchroObject.h,v 1.2 2001-07-12 19:57:44 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class sun_jvmp_generic_motif_PthreadSynchroObject */
#ifndef _Included_sun_jvmp_generic_motif_PthreadSynchroObject
#define _Included_sun_jvmp_generic_motif_PthreadSynchroObject
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: sun_jvmp_generic_motif_PthreadSynchroObject
* Method: checkHandle
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_checkHandle
(JNIEnv *, jobject, jlong);
/*
* Class: sun_jvmp_generic_motif_PthreadSynchroObject
* Method: doDestroy
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doDestroy
(JNIEnv *, jobject, jlong);
/*
* Class: sun_jvmp_generic_motif_PthreadSynchroObject
* Method: doLock
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doLock
(JNIEnv *, jobject, jlong);
/*
* Class: sun_jvmp_generic_motif_PthreadSynchroObject
* Method: doNotify
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doNotify
(JNIEnv *, jobject, jlong);
/*
* Class: sun_jvmp_generic_motif_PthreadSynchroObject
* Method: doNotifyAll
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doNotifyAll
(JNIEnv *, jobject, jlong);
/*
* Class: sun_jvmp_generic_motif_PthreadSynchroObject
* Method: doUnlock
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doUnlock
(JNIEnv *, jobject, jlong);
/*
* Class: sun_jvmp_generic_motif_PthreadSynchroObject
* Method: doWait
* Signature: (JI)I
*/
JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doWait
(JNIEnv *, jobject, jlong, jint);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,127 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: sun_jvmp_mozilla_JSObject.h,v 1.2 2001-07-12 19:57:46 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class sun_jvmp_mozilla_JSObject */
#ifndef _Included_sun_jvmp_mozilla_JSObject
#define _Included_sun_jvmp_mozilla_JSObject
#ifdef __cplusplus
extern "C" {
#endif
/* Inaccessible static: m_evaluator */
/*
* Class: sun_jvmp_mozilla_JSObject
* Method: JSFinalize
* Signature: (IIJ)V
*/
JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_JSObject_JSFinalize
(JNIEnv *, jclass, jint, jint, jlong);
/*
* Class: sun_jvmp_mozilla_JSObject
* Method: JSGetNativeJSObject
* Signature: (JLjava/lang/String;[[B[IILjava/security/AccessControlContext;)I
*/
JNIEXPORT jint JNICALL Java_sun_jvmp_mozilla_JSObject_JSGetNativeJSObject
(JNIEnv *, jclass, jlong, jstring, jobjectArray, jintArray, jint, jobject);
/*
* Class: sun_jvmp_mozilla_JSObject
* Method: JSGetThreadID
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_sun_jvmp_mozilla_JSObject_JSGetThreadID
(JNIEnv *, jclass, jlong);
/*
* Class: sun_jvmp_mozilla_JSObject
* Method: JSObjectCall
* Signature: (IIJLjava/lang/String;[[B[IILjava/lang/String;[Ljava/lang/Object;Ljava/security/AccessControlContext;)Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectCall
(JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jstring, jobjectArray, jobject);
/*
* Class: sun_jvmp_mozilla_JSObject
* Method: JSObjectEval
* Signature: (IIJLjava/lang/String;[[B[IILjava/lang/String;Ljava/security/AccessControlContext;)Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectEval
(JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jstring, jobject);
/*
* Class: sun_jvmp_mozilla_JSObject
* Method: JSObjectGetMember
* Signature: (IIJLjava/lang/String;[[B[IILjava/lang/String;Ljava/security/AccessControlContext;)Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectGetMember
(JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jstring, jobject);
/*
* Class: sun_jvmp_mozilla_JSObject
* Method: JSObjectGetSlot
* Signature: (IIJLjava/lang/String;[[B[IIILjava/security/AccessControlContext;)Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectGetSlot
(JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jint, jobject);
/*
* Class: sun_jvmp_mozilla_JSObject
* Method: JSObjectRemoveMember
* Signature: (IIJLjava/lang/String;[[B[IILjava/lang/String;Ljava/security/AccessControlContext;)V
*/
JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectRemoveMember
(JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jstring, jobject);
/*
* Class: sun_jvmp_mozilla_JSObject
* Method: JSObjectSetMember
* Signature: (IIJLjava/lang/String;[[B[IILjava/lang/String;Ljava/lang/Object;Ljava/security/AccessControlContext;)V
*/
JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectSetMember
(JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jstring, jobject, jobject);
/*
* Class: sun_jvmp_mozilla_JSObject
* Method: JSObjectSetSlot
* Signature: (IIJLjava/lang/String;[[B[IIILjava/lang/Object;Ljava/security/AccessControlContext;)V
*/
JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectSetSlot
(JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jint, jobject, jobject);
/*
* Class: sun_jvmp_mozilla_JSObject
* Method: JSObjectToString
* Signature: (IIJ)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectToString
(JNIEnv *, jclass, jint, jint, jlong);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,70 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: sun_jvmp_mozilla_JavaScriptProtectionDomain.h,v 1.2 2001-07-12 19:57:46 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class sun_jvmp_mozilla_JavaScriptProtectionDomain */
#ifndef _Included_sun_jvmp_mozilla_JavaScriptProtectionDomain
#define _Included_sun_jvmp_mozilla_JavaScriptProtectionDomain
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: sun_jvmp_mozilla_JavaScriptProtectionDomain
* Method: finalize
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_finalize
(JNIEnv *, jobject, jlong);
/*
* Class: sun_jvmp_mozilla_JavaScriptProtectionDomain
* Method: getCodeBase
* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_getCodeBase
(JNIEnv *, jclass, jlong);
/*
* Class: sun_jvmp_mozilla_JavaScriptProtectionDomain
* Method: getRawCerts
* Signature: (J)[[B
*/
JNIEXPORT jobjectArray JNICALL Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_getRawCerts
(JNIEnv *, jclass, jlong);
/*
* Class: sun_jvmp_mozilla_JavaScriptProtectionDomain
* Method: implies
* Signature: (JLjava/lang/String;Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_implies
(JNIEnv *, jobject, jlong, jstring, jstring);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,83 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: sun_jvmp_mozilla_MozillaAppletPeer.h,v 1.2 2001-07-12 19:57:46 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class sun_jvmp_mozilla_MozillaAppletPeer */
#ifndef _Included_sun_jvmp_mozilla_MozillaAppletPeer
#define _Included_sun_jvmp_mozilla_MozillaAppletPeer
#ifdef __cplusplus
extern "C" {
#endif
/* Inaccessible static: appletPanels */
/* Inaccessible static: audioClips */
/* Inaccessible static: imageRefs */
/*
* Class: sun_jvmp_mozilla_MozillaAppletPeer
* Method: finalizeParams
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_MozillaAppletPeer_finalizeParams
(JNIEnv *, jobject);
/*
* Class: sun_jvmp_mozilla_MozillaAppletPeer
* Method: getParams
* Signature: ()[[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_sun_jvmp_mozilla_MozillaAppletPeer_getParams
(JNIEnv *, jobject);
/*
* Class: sun_jvmp_mozilla_MozillaAppletPeer
* Method: nativeShowDocument
* Signature: (Ljava/lang/String;Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeShowDocument
(JNIEnv *, jobject, jstring, jstring);
/*
* Class: sun_jvmp_mozilla_MozillaAppletPeer
* Method: nativeShowStatus
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeShowStatus
(JNIEnv *, jobject, jstring);
/*
* Class: sun_jvmp_mozilla_MozillaAppletPeer
* Method: nativeReturnJObject
* Signature: (Ljava/lang/Object;J)V
*/
JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeReturnJObject
(JNIEnv *, jobject, jobject, jlong);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,55 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: sun_jvmp_mozilla_MozillaPeerFactory.h,v 1.2 2001-07-12 19:57:46 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class sun_jvmp_mozilla_MozillaPeerFactory */
#ifndef _Included_sun_jvmp_mozilla_MozillaPeerFactory
#define _Included_sun_jvmp_mozilla_MozillaPeerFactory
#ifdef __cplusplus
extern "C" {
#endif
/* Inaccessible static: initialized */
/*
* Class: sun_jvmp_mozilla_MozillaPeerFactory
* Method: nativeGetProxyInfoForURL
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_sun_jvmp_mozilla_MozillaPeerFactory_nativeGetProxyInfoForURL
(JNIEnv *, jobject, jstring);
/*
* Class: sun_jvmp_mozilla_MozillaPeerFactory
* Method: nativeHandleCall
* Signature: (IJ)I
*/
JNIEXPORT jint JNICALL Java_sun_jvmp_mozilla_MozillaPeerFactory_nativeHandleCall
(JNIEnv *, jobject, jint, jlong);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,89 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: JSException.java,v 1.1 2001-07-12 20:25:44 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package netscape.javascript;
// exception that can be thrown by LiveConnect in Mozilla.
public class JSException extends RuntimeException {
// Exception type supported by JavaScript 1.4 in Mozilla
public static final int EXCEPTION_TYPE_EMPTY = -1;
public static final int EXCEPTION_TYPE_VOID = 0;
public static final int EXCEPTION_TYPE_OBJECT = 1;
public static final int EXCEPTION_TYPE_FUNCTION = 2;
public static final int EXCEPTION_TYPE_STRING = 3;
public static final int EXCEPTION_TYPE_NUMBER = 4;
public static final int EXCEPTION_TYPE_BOOLEAN = 5;
public static final int EXCEPTION_TYPE_ERROR = 6;
public JSException() {
this(null);
}
public JSException(String s) {
this(s, null, -1, null, -1);
}
public JSException(String s, String filename, int lineno, String source,
int tokenIndex) {
super(s);
this.message = s;
this.filename = filename;
this.lineno = lineno;
this.source = source;
this.tokenIndex = tokenIndex;
this.wrappedExceptionType = EXCEPTION_TYPE_EMPTY;
}
public JSException(int wrappedExceptionType, Object wrappedException) {
this();
this.wrappedExceptionType = wrappedExceptionType;
this.wrappedException = wrappedException;
}
protected String message = null;
protected String filename = null;
protected int lineno = -1;
protected String source = null;
protected int tokenIndex = -1;
private int wrappedExceptionType = -1;
private Object wrappedException = null;
public int getWrappedExceptionType() {
return wrappedExceptionType;
}
public Object getWrappedException() {
return wrappedException;
}
}

View File

@@ -1,93 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: JSObject.java,v 1.1 2001-07-12 20:25:45 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package netscape.javascript;
import java.applet.Applet;
import java.applet.AppletContext;
import sun.jvmp.javascript.JSContext;
public abstract class JSObject {
/**
* Call to JS
**/
public abstract Object call(String methodName,
Object args[])
throws JSException;
/**
* Evaluate JS expression
*/
public abstract Object eval(String s) throws JSException;
/**
* Obtain member of JS object
*/
public abstract Object getMember(String name) throws JSException;
/**
* Set member of JS object
*/
public abstract void setMember(String name, Object value) throws JSException;
/**
* Remove member of JS object
*/
public abstract void removeMember(String name) throws JSException;
/**
* Obtain slot of JS object
*/
public abstract Object getSlot(int index) throws JSException;
/**
* Set slot of JS object
*/
public abstract void setSlot(int index, Object value) throws JSException;
/**
* Returns a JSObject for the window containing the given applet.
*/
public static JSObject getWindow(Applet applet) throws JSException {
AppletContext c = applet.getAppletContext();
JSObject ret = null;
if (c instanceof sun.jvmp.javascript.JSContext)
{
JSContext j = (JSContext) c;
ret = j.getJSObject();
}
if (ret == null)
throw new JSException("AppletContext doesn\'t provide correct JSContext");
else
return ret;
}
}

View File

@@ -1,45 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: JSUtil.java,v 1.1 2001-07-12 20:25:46 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package netscape.javascript;
import java.io.*;
public class JSUtil {
/* Return the stack trace of an exception or error as a String */
public static String getStackTrace(Throwable t) {
ByteArrayOutputStream captureStream;
PrintWriter p;
captureStream = new ByteArrayOutputStream();
p = new PrintWriter(captureStream);
t.printStackTrace(p);
p.flush();
return captureStream.toString();
}
}

View File

@@ -1,40 +0,0 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: plugin.policy,v 1.2 2001-07-12 19:57:51 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
grant codeBase "file:${jvmp.home}/classes/*" {
permission java.security.AllPermission;
};
grant codeBase "file:${jvmp.home}/wf.jar" {
permission java.security.AllPermission;
};
grant {
permission java.lang.RuntimePermission "accessClassInPackage.sun.jvmp";
permission java.lang.RuntimePermission "accessClassInPackage.sun.jvmp.applet";
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.action";
permission java.lang.RuntimePermission "accessClassInPackage.sun.awt.image";
permission java.lang.RuntimePermission "accessClassInPackage.sun.audio";
permission java.lang.RuntimePermission "accessClassInPackage.sun.applet";
permission java.lang.RuntimePermission "modifyThread";
};

View File

@@ -1,40 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: BrowserSupport.java,v 1.2 2001-07-12 19:57:52 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
import java.net.URL;
import java.net.URLConnection;
import sun.jvmp.applet.ProxyInfo;
/**
* Generic interface of browser support
*/
public interface BrowserSupport
{
public ProxyInfo getProxyInfoForURL(URL url);
public URLConnection getConnectionForURL(URL url);
}

View File

@@ -1,38 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: ComponentException.java,v 1.2 2001-07-12 19:57:52 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
public class ComponentException extends Exception
{
String message="Component exception";
public ComponentException(String message)
{
this.message = message;
}
public ComponentException()
{}
};

View File

@@ -1,123 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: ComponentLoader.java,v 1.2 2001-07-12 19:57:52 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
import java.net.URL;
import java.net.URLClassLoader;
import java.beans.*;
import java.io.*;
import java.util.jar.*;
import java.lang.reflect.*;
import java.security.CodeSource;
class ComponentLoader
{
protected PluggableJVM jvm;
ComponentLoader(PluggableJVM jvm)
{
this.jvm = jvm;
}
/**
* Load component from the given URL.
* It should be a JAR with attribute "Factory-Class" set to the name of
* factory class of this component.
**/
public ObjectFactory getComponent(URL url)
{
try {
//jvm.trace("url="+url, jvm.LOG_DEBUG);
JarInputStream jis = new JarInputStream(url.openStream());
URL wfcp = jvm.getCodeSource().getLocation();
// yes - own classloader for every component - must be safer
URLClassLoader comploader = new URLClassLoader(new URL [] {url, wfcp},
this.getClass().getClassLoader());
Class factory = null;
Manifest mf = jis.getManifest();
Attributes a = mf.getMainAttributes();
String classname =
a.getValue(new Attributes.Name("Factory-Class"));
// if this component not pretend to be autoregistered
// just skip it
if (classname == null) return null;
factory = Class.forName(classname, true, comploader);
Method m = factory.getDeclaredMethod("getFactory",
new Class[]{PluggableJVM.class,
CodeSource.class});
CodeSource cs = new CodeSource(url, null);
Object o = m.invoke(null, new Object[]{jvm, cs});
return (ObjectFactory)o;
} catch (Exception e) {
// as I'm such a lazy butt to perform all checks here
jvm.trace("getComponent failed: "+e, PluggableJVM.LOG_WARNING);
jvm.trace(e, PluggableJVM.LOG_WARNING);
return null;
}
}
public void register(URL url)
{
ObjectFactory of = getComponent(url);
if (of == null) return;
jvm.registerService(of);
}
/**
* Autoregister components from those locations
**/
public void register(URL[] urls)
{
if (urls == null) return;
for (int i=0; i<urls.length; i++)
register(urls[i]);
}
/**
* Autoregister all components from some directory
**/
public void registerAllInDir(File dir)
{
if (dir == null || !dir.isDirectory()) return;
File[] comps = dir.listFiles();
if (comps == null) return;
for (int i=0; i<comps.length; i++)
{
try {
if (comps[i].isFile()) register(comps[i].toURL());
} catch(Exception e) {
jvm.trace("registerAllInDir failed: "+e,
PluggableJVM.LOG_WARNING);
}
}
}
};

View File

@@ -1,255 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: ConsoleWindow.java,v 1.1 2001-07-12 20:25:49 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
import java.awt.*;
import java.awt.event.*;
import java.util.Enumeration;
class ConsoleWindow extends Frame {
PluggableJVM m_jvm = null;
int debugLevel = 10;
/*
* Create the new console window
*/
public ConsoleWindow(PluggableJVM jvm) {
super("Waterfall Java Console");
m_jvm = jvm;
setResizable(true);
setLayout(new BorderLayout());
textArea = new TextArea();
add(textArea, BorderLayout.CENTER);
Button clear = new Button("Clear");
Button close = new Button("Close");
Panel panel = new Panel();
panel.setLayout(new FlowLayout(FlowLayout.CENTER));
panel.add(clear);
panel.add(new Label(" "));
panel.add(close);
KeyListener keyListener = new KeyAdapter() {
public void keyPressed(KeyEvent evt) {
switch (evt.getKeyCode()) {
// those events passed to default handlers
case KeyEvent.VK_KP_DOWN:
case KeyEvent.VK_KP_UP:
case KeyEvent.VK_KP_LEFT:
case KeyEvent.VK_KP_RIGHT:
case KeyEvent.VK_DOWN:
case KeyEvent.VK_UP:
case KeyEvent.VK_LEFT:
case KeyEvent.VK_RIGHT:
case KeyEvent.VK_PAGE_UP:
case KeyEvent.VK_PAGE_DOWN:
case KeyEvent.VK_END:
case KeyEvent.VK_HOME:
return;
}
switch (evt.getKeyChar()) {
case '?':
case 'h':
case 'H':
printHelp();
break;
case 't':
case 'T':
dumpThreads();
break;
case 'g':
case 'G':
System.out.println("running garbage collector...");
System.gc();
System.out.println("done.");
break;
case 'f':
case 'F':
System.out.println("finalize objects...");
System.runFinalization();
System.out.println("done.");
break;
case 'm':
case 'M':
Runtime r = Runtime.getRuntime();
System.out.println("Memory usage: free "+
r.freeMemory() +
" of total " +
r.totalMemory());
break;
case 'c':
case 'C':
textArea.setText("");
break;
case 'q':
case 'Q':
hide();
break;
case 'o':
case 'O':
dumpObjs();
break;
case 'V':
m_jvm.setDebugLevel(++debugLevel);
System.out.println("new debug level="+debugLevel);
break;
case 'v':
m_jvm.setDebugLevel(--debugLevel);
System.out.println("new debug level="+debugLevel);
break;
default:
}
// don't propagate further
evt.consume();
}
public void keyReleased(KeyEvent evt) {
}
public void keyTyped(KeyEvent evt) {
}
};
addKeyListener(keyListener);
textArea.addKeyListener(keyListener);
WindowListener windowEventListener = new WindowAdapter() {
public void windowClosing(WindowEvent evt) {
dispose();
}
};
addWindowListener(windowEventListener);
int rgb = SystemColor.control.getRGB();
panel.setBackground(new Color(rgb));
add(panel, BorderLayout.SOUTH);
clear.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
synchronized (textArea) {
textArea.setText("");
};
}
});
close.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
hide();
}
});
setSize(400,300);
pack();
}
void printHelp()
{
System.out.println("Waterfall Java Console commands:");
System.out.println(" h - print this message");
System.out.println(" t - print all Java threads");
System.out.println(" g - run garbage collector");
System.out.println(" f - finalize objects in finalizer queue");
System.out.println(" m - print memory usage");
System.out.println(" c - clear console");
System.out.println(" q - close console");
System.out.println(" o - show all objects");
System.out.println(" V/v - increase/decrease verbosity");
}
void dumpThreads()
{
System.out.println("Threads list:");
Thread t = Thread.currentThread();
ThreadGroup tg = t.getThreadGroup();
// find root thread group
while (tg.getParent() != null) tg = tg.getParent();
// now dump leafs
dumpThreadGroup(tg);
}
void dumpThreadGroup(ThreadGroup tg)
{
if (tg == null) return;
int cnt = tg.activeCount();
System.out.println(" Thread group "+tg.getName());
Thread[] tlist = new Thread [cnt];
cnt = tg.enumerate(tlist);
for (int i=0; i < cnt; i++)
System.out.println(" "+tlist[i]);
int tgcnt = tg.activeGroupCount();
ThreadGroup[] tglist = new ThreadGroup[tgcnt];
tgcnt = tg.enumerate(tglist);
for (int i=0; i < tgcnt; i++)
dumpThreadGroup(tglist[i]);
}
void dumpObjs()
{
System.out.println("Registered extensions:");
for (Enumeration e = m_jvm.getAllExtensions(); e.hasMoreElements();)
{
WaterfallExtension ext = (WaterfallExtension)e.nextElement();
if (ext != null) System.out.println(" " + ext);
}
System.out.println("Registered windows:");
for (Enumeration e = m_jvm.getAllFrames(); e.hasMoreElements();)
{
NativeFrame nf = (NativeFrame)e.nextElement();
if (nf != null) System.out.println(" " + nf);
}
System.out.println("Registered objects:");
for (Enumeration e = m_jvm.getAllPeers(); e.hasMoreElements();)
{
HostObjectPeer p = (HostObjectPeer)e.nextElement();
if (p != null) System.out.println(" " + p);
}
System.out.println("Registered threads:");
for (Enumeration e = m_jvm.getAllThreads(); e.hasMoreElements();)
{
NativeThread t = (NativeThread)e.nextElement();
if (t != null) System.out.println(" " + t);
}
System.out.println("Registered synchro objects:");
for (Enumeration e = m_jvm.getAllSynchroObjects(); e.hasMoreElements();)
{
SynchroObject so = (SynchroObject)e.nextElement();
if (so != null) System.out.println(" " + so);
}
return;
}
public void append(String text) {
synchronized (textArea) {
textArea.append(text);
};
}
private TextArea textArea;
}

View File

@@ -1,80 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: DebugOutputStream.java,v 1.1 2001-07-12 20:25:50 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
import java.io.*;
public class DebugOutputStream extends OutputStream
{
ConsoleWindow console;
FileOutputStream log;
public DebugOutputStream(ConsoleWindow console,
String filename)
{
this.console = console;
if (filename != null)
{
String wfHome = System.getProperty("jvmp.home");
try {
File file = new File(wfHome, filename);
if (file.exists()) file.delete();
log = new FileOutputStream(file);
} catch (IOException e) {
e.printStackTrace();
}
}
}
public synchronized void write(byte b[], int off, int len)
throws IOException
{
if (console != null)
console.append(new String(b, off, len));
if (log != null)
{
try {
log.write(b, off, len);
} catch (IOException e) {
if (console != null)
console.append(e.toString());
}
}
}
public synchronized void write(int b) throws IOException
{
System.err.println("char write: "+b);
// inefficient implementation, but short writes shouldn't happen often
byte buf[] = new byte[1];
buf[0] = (byte)b;
write(buf, 0, 1);
}
public synchronized void flush() throws IOException {
if (log != null) log.flush();
}
}

View File

@@ -1,103 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: HostObjectPeer.java,v 1.2 2001-07-12 19:57:53 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
import sun.jvmp.security.*;
// peer event types, synchronize with nsIJavaHTMLObject.idl
public interface HostObjectPeer extends IDObject
{
/**
* Some peer types. Just for reference.
**/
public static final int PT_UNKNOWN = 0;
public static final int PT_EMBED = 1;
public static final int PT_OBJECT = 2;
public static final int PT_APPLET = 3;
public static final int PT_PLUGLET = 4;
/**
* Some peer events. Just for reference.
**/
public static final int PE_NOPE = 0;
public static final int PE_CREATE = 1;
public static final int PE_SETWINDOW = 2;
public static final int PE_DESTROY = 3;
public static final int PE_START = 4;
public static final int PE_STOP = 5;
public static final int PE_NEWPARAMS = 6;
public static final int PE_SETTYPE = 7;
public static final int PE_PEEREVENT = 8;
public static final int PE_GETPEER = 9;
/**
* Java object events - usage is voluntary.
**/
public static final int JE_NOPE = 0;
public static final int JE_SHOWSTATUS = 1;
public static final int JE_SHOWDOCUMENT = 2;
// generic event sent by applet
public static final int JE_APPLETEVENT = 3;
// error requiring browser's attention happened in applet
public static final int JE_APPLETERROR = 4;
// error requiring browser's attention happened in JVM
public static final int JE_JVMERROR = 5;
/**
* returns pointer to peer factory used to create this peer
**/
public HostObjectPeerFactory getFactory();
/**
* Event handler - called when SendEvent/PostEvent methods called.
* Calls comes directly from PluggableJVM main event loop -
* maybe it's better for each peer to have own message queue,
* but it will make performance overhead.
**/
public int handleEvent(SecurityCaps caps, int eventID, long eventData);
/**
* This method is called directly from native thread -
* do anything you want.
**/
public int handleCall(SecurityCaps caps, int arg1, long arg2);
/**
* Method called when host calls JVMP_DestroyPeer.
* Final clean up here. Return 0 if don't want to die, or caps
* isn't good enough.
*/
public int destroy(SecurityCaps caps);
};

View File

@@ -1,67 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: HostObjectPeerFactory.java,v 1.2 2001-07-12 19:57:53 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
import sun.jvmp.security.*;
import java.security.*;
// interface that should be implemented by all Waterfall extensions
// Java classes.
// creates Java peer of given version.
// vendor ID is already fixed, and should be known by this factory
public interface HostObjectPeerFactory extends IDObject
{
public String getCID();
public HostObjectPeer create(int version);
/**
* Event handler - called when SendExtEvent/PostExtEvent methods called.
* Calls comes directly from PluggableJVM main event loop -
* maybe it's better for each extension to have own message queue,
* but it will make performance overhead.
**/
public int handleEvent(SecurityCaps caps,
int eventID,
long eventData);
/**
* This method is called directly from native thread -
* do anything you want.
**/
public int handleCall(SecurityCaps caps, int arg1, long arg2);
/**
* Method called when host calls JVMP_UnregisterExtension.
* Final clean up here. Return 0 if don't want to die, or caps
* isn't good enough.
*/
public int destroy(SecurityCaps caps);
/**
* Returns permission collection required for this extension to work
* properly, null if nothing
*/
public PermissionCollection getPermissions(CodeSource codesource);
}

View File

@@ -1,146 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: IDList.java,v 1.2 2001-07-12 19:57:53 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
import java.util.Vector;
import java.util.Enumeration;
import java.util.Hashtable;
public class IDList {
protected Vector m_items;
protected Hashtable m_ids;
// this is common for all instances
static int m_nextID = 1;
public IDList()
{
m_items = new Vector(0, 5);
m_ids = new Hashtable();
}
// this is way to make all IDList's error-prone, as
// ID will be truly unique for all instances
static synchronized int getNextID()
{
if (m_nextID == Integer.MAX_VALUE) m_nextID = 1;
return m_nextID++;
}
// XXX: reimplement it with smth more efficient
int getStorage(int id)
{
Integer storage = (Integer)m_ids.get(new Integer(id));
if (storage == null) return -1;
return storage.intValue();
}
int getId(int storage)
{
int id = getNextID();
m_ids.put(new Integer(id), new Integer(storage));
return id;
}
public synchronized int add(IDObject o)
{
int id = 0, free_slot = -1;
if (o == null) return 0; // null objects cannot be saved
// first - find out if this object already added
// reverse order - to give smallest IDs first.
for (int i = m_items.size()-1; i >= 0; i--)
{
IDObject o1 = (IDObject)m_items.elementAt(i);
if (o1 == null)
{
free_slot = i;
}
else
{
if (o1.equals(o))
{
id = o1.getID();
o.setID(id);
return id;
}
}
}
if (free_slot != -1)
{
id = getId(free_slot);
m_items.setElementAt(o, free_slot);
}
else
{
m_items.addElement(o);
id = getId(m_items.indexOf(o));
}
o.setID(id);
return id;
}
// XXX: should I shrink underlying Vector?
public synchronized IDObject remove(int id)
{
IDObject o = get(id);
m_items.setElementAt(null, getStorage(id));
return o;
}
public synchronized IDObject remove(IDObject o)
{
if (o == null) return null;
for (int i = 0; i < m_items.size(); i++)
{
IDObject o1 = (IDObject)m_items.elementAt(i);
if (o.equals(o1))
{
m_items.setElementAt(null, i);
return o1;
}
}
return null;
}
public synchronized IDObject get(int id)
{
int storage = getStorage(id);
if (storage == -1) return null;
return (IDObject)m_items.elementAt(storage);
}
public synchronized int length()
{
int count = 0;
for (int i = 0; i < m_items.size(); i++)
if (m_items.elementAt(i) != null) count++;
return count;
}
public Enumeration elements()
{
return m_items.elements();
}
}

View File

@@ -1,31 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: IDObject.java,v 1.2 2001-07-12 19:57:53 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
public interface IDObject {
public void setID(int id);
public int getID();
}

View File

@@ -1,52 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: MultipleHashtable.java,v 1.2 2001-07-12 19:57:53 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
import java.util.*;
/**
* utility class - hashtable with multiple values per key
**/
public class MultipleHashtable extends Hashtable
{
public MultipleHashtable()
{
super();
}
public Object put(Object key, Object value)
{
Vector v = getVector(key);
if (v == null) v = new Vector();
v.addElement(value);
return super.put(key, v);
}
public Vector getVector(Object key)
{
return (Vector)super.get(key);
}
}

View File

@@ -1,72 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: NativeFrame.java,v 1.2 2001-07-12 19:57:53 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
import java.awt.*;
public class NativeFrame implements IDObject
{
protected Frame m_f;
protected int m_id = 0;
public NativeFrame(Frame f)
{
m_f = f;
}
public void setID(int id)
{
if (m_id !=0) return;
m_id = id;
}
public int getID()
{
return m_id;
}
public Frame getFrame()
{
return m_f;
}
public boolean equals(Object obj)
{
NativeFrame f;
if (obj == null) return false;
try {
f = (NativeFrame)obj;
} catch (ClassCastException e) {
return false;
}
return (m_f == f.getFrame());
}
public String toString()
{
if (m_f != null) return m_f.toString();
return "null NativeFrame object";
}
}

View File

@@ -1,70 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: NativeThread.java,v 1.2 2001-07-12 19:57:54 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
public class NativeThread implements IDObject
{
protected Thread m_t;
protected int m_id = 0;
public NativeThread(Thread t)
{
m_t = t;
}
public void setID(int id)
{
if (m_id !=0) return;
m_id = id;
}
public int getID()
{
return m_id;
}
public Thread getThread()
{
return m_t;
}
public boolean equals(Object obj)
{
NativeThread t;
if (obj == null) return false;
try {
t = (NativeThread)obj;
} catch (ClassCastException e) {
return false;
}
return (m_t == t.getThread());
}
public String toString()
{
if (m_t != null) return m_t.toString();
return "null NativeThread object";
}
}

View File

@@ -1,82 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: ObjectFactory.java,v 1.2 2001-07-12 19:57:54 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
import java.util.Enumeration;
import java.security.*;
/**
* This interface describes interface to be implemented by object factory
* if it likes to be used by Waterfall actors.
* Protocol:
* 1. getCIDs(), if returned null - done
* 2. call handleConflict() on every conflicting CID (see handleConflict())
* XXX: shouldn't interface be locked on conflict resolution time?
* 3. now object factory is ready to produce object instances using
* instantiate()
* 4. also permissions provided by this ObjectFactory used by system policy
**/
public interface ObjectFactory {
/**
* Returns name of this object factory. Also can be used for
* versioning, i.e. name can be
* WF-AppletViewer:00001
* and so useful in conflict resolution
**/
public String getName();
/**
* Returns list of CIDs this object factory provides
**/
public Enumeration getCIDs();
/**
* This method called with a rejected CID and conficting object factory.
* Returned value true if ObjectFactory insist to be the owner of this CID,
* false otherwise.
* If both returned true, or both returned false - status quo is saved.
* Otherwise factory returned true becomes owner of CID.
* Using this protocol, versioning issues can be solved easily.
**/
public boolean handleConflict(String cid,
ObjectFactory f);
/**
* When Waterfall asked to create instance of object with given CID
* - this method got called.
**/
public Object instantiate(String cid, Object arg);
/**
* Object factory allowed to extend Waterfall security policy
* using this method. Usually this method used to grant certain
* permissions to itself, but also can be used to define system-wide policy.
* This isn't recommended in generic case, but some kind of extensions,
* for example applet viewers, cannot avoid it.
**/
public PermissionCollection getPermissions(CodeSource codesource);
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,50 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: SynchroObject.java,v 1.2 2001-07-12 19:57:54 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
public abstract class SynchroObject implements IDObject
{
protected int m_id = 0;
/* much like standard Java synchro API */
public abstract void _lock();
public abstract void _unlock();
public abstract void _wait(int milli) throws InterruptedException;
public abstract void _notify();
public abstract void _notifyAll();
public abstract void _destroy();
public void setID(int id)
{
if (m_id != 0) return;
m_id = id;
}
public int getID()
{
return m_id;
}
}

View File

@@ -1,231 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: WaterfallExtension.java,v 1.2 2001-07-12 19:57:54 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp;
import sun.jvmp.security.*;
import java.lang.reflect.*;
import java.net.*;
import java.util.*;
import sun.jvmp.security.*;
import java.security.*;
import java.io.*;
class WaterfallExtension implements AccessControlDecider, IDObject
{
protected int m_version;
protected String m_cid;
protected int m_id;
Class bootstrapClass = null;
ClassLoader extClassLoader;
boolean inited;
HostObjectPeerFactory factory;
AccessControlDecider decider;
PluggableJVM m_jvm;
String m_classpath, m_classname;
public WaterfallExtension(PluggableJVM jvm, String cid, int version,
String classpath, String classname,
long data)
throws ClassNotFoundException,
MalformedURLException,
NoSuchMethodException,
SecurityException,
IllegalAccessException,
IllegalArgumentException,
InvocationTargetException
{
inited = false;
m_cid = cid;
m_version = version;
m_jvm = jvm;
m_classpath = classpath;
m_classname = classname;
try
{
// XXX: I dunno, if default should be in classpath
classpath = //getDefaultClassPath() +
classpath;
URL[] urls = getURLs(classpath);
ClassLoader loader = this.getClass().getClassLoader();
extClassLoader = new URLClassLoader(urls, loader);
bootstrapClass =
Class.forName(classname, true, extClassLoader);
Method start =
bootstrapClass.getDeclaredMethod("start",
new Class[]{PluggableJVM.class, Long.class});
// start() is a static method - returns factory
// to produce instances of desired type
factory = (HostObjectPeerFactory)
start.invoke(null, new Object[]{m_jvm, new Long(data)});
decider = (AccessControlDecider)factory;
if (!m_cid.equals(factory.getCID()))
{
// smth is wrong, created object
// is of incorrect type
m_jvm.trace("RETURNED CONTRACT ID ISN'T CORRECT",
PluggableJVM.LOG_ERROR);
// XXX: correct exception?
throw new
IllegalArgumentException("Mismatch contract ID: "+
factory.getCID() +
" instead of "+ m_cid);
}
}
catch (ClassCastException e)
{
m_jvm.trace("Extension class not implements required interfaces",
PluggableJVM.LOG_ERROR);
m_jvm.trace(e, PluggableJVM.LOG_ERROR);
throw e;
}
catch (MalformedURLException e)
{
m_jvm.trace("Oops, can't create URLs from\""
+classpath+"\"", PluggableJVM.LOG_ERROR);
throw e;
}
catch (ClassNotFoundException e)
{
m_jvm.trace("Oops, can't find class \""
+classname+"\"", PluggableJVM.LOG_ERROR);
throw e;
}
catch (NoSuchMethodException e)
{
m_jvm.trace("No start method in class "+classname,
PluggableJVM.LOG_ERROR);
throw e;
}
//PluggableJVM.trace("+++++++ Extension inited");
inited = true;
}
public void setID(int id)
{
if (m_id != 0) return;
if (factory != null) factory.setID(id);
m_id = id;
}
public int getID()
{
return m_id;
}
public String getCID()
{
return m_cid;
}
public int getVersion()
{
return m_version;
}
public HostObjectPeer instantiate(SecurityCaps caps, int version)
{
if (!inited)
return null;
return factory.create(version);
}
public int decide(CallingContext ctx, String principal, int cap_no)
{
if (decider == null) return NA;
return decider.decide(ctx, principal, cap_no);
}
public boolean belongs(int cap_no)
{
if (decider == null) return false;
return decider.belongs(cap_no);
}
protected URL[] getURLs(String classpath)
throws MalformedURLException
{
int i, pos, count;
URL url;
if (classpath == null || "".equals(classpath)) return new URL[]{};
Vector v = new Vector();
pos = count = 0;
do
{
count++;
i = classpath.indexOf("|", pos);
if (i == -1)
url = new URL(classpath.substring(pos));
else
url = new URL(classpath.substring(pos, i));
m_jvm.trace("adding URL: "+ url, PluggableJVM.LOG_DEBUG);
v.addElement(url);
pos = i+1;
}
while (i > -1);
URL[] urls = (URL[])(v.toArray(new URL[v.size()]));
return urls;
}
public HostObjectPeerFactory getFactory()
{
return factory;
}
public String toString()
{
StringBuffer buf = new StringBuffer();
buf.append("Waterfall extension: ");
buf.append("classpath=\""+m_classpath+"\" classname="+m_classname+"\n");
buf.append("cid="+m_cid+" version="+m_version);
if (factory != null) buf.append(" factory=" + factory.toString());
return buf.toString();
}
protected String getDefaultClassPath()
{
StringBuffer sb = new StringBuffer();
String wfHome = System.getProperty("jvmp.home");
File dir = new File(wfHome, "ext");
if (dir == null || !dir.isDirectory()) return "";
File[] comps = dir.listFiles();
if (comps == null) return "";
// try {
// for (int i=0; i<comps.length; i++)
// if (comps[i].isFile())
// sb.append(comps[i].toURL().toString()+"|");
// } catch(Exception e) {
// }
// return sb.toString();
return "";
}
}

View File

@@ -1,55 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: AppletManager.java,v 1.1 2001-07-12 20:25:54 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.applet;
import sun.jvmp.*;
import java.util.Hashtable;
public class AppletManager
{
PluggableJVM jvm;
public AppletManager(PluggableJVM jvm)
{
this.jvm = jvm;
}
public WFAppletViewer createAppletViewer(WFAppletContext ctx,
BrowserSupport support,
Hashtable atts)
{
if (jvm == null) return null;
AppletViewerArgs arg = new AppletViewerArgs(ctx, support, atts, jvm);
WFAppletViewer av = null;
try {
av = (WFAppletViewer)jvm.getServiceByCID(WFAppletViewer.CID, arg);
} catch (ClassCastException cce) {
jvm.trace("WFAppletViewer interface not implemented by applet viewer",
PluggableJVM.LOG_ERROR);
}
return av;
}
};

View File

@@ -1,48 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: AppletViewerArgs.java,v 1.1 2001-07-12 20:25:56 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.applet;
import sun.jvmp.BrowserSupport;
import java.util.Hashtable;
import sun.jvmp.PluggableJVM;
public class AppletViewerArgs
{
public AppletViewerArgs(WFAppletContext ctx,
BrowserSupport support,
Hashtable atts,
PluggableJVM jvm)
{
this.ctx = ctx;
this.support = support;
this.atts = atts;
this.jvm = jvm;
}
public WFAppletContext ctx;
public BrowserSupport support;
public Hashtable atts;
public PluggableJVM jvm;
}

View File

@@ -1,39 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: ProxyHandler.java,v 1.1 2001-07-12 20:25:56 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.applet;
import java.net.URL;
public interface ProxyHandler {
/* getProxyInfo takes a particular URL and returns its proxy setting.
*/
ProxyInfo getProxyInfo(URL u);
}

View File

@@ -1,121 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: ProxyInfo.java,v 1.1 2001-07-12 20:25:56 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.applet;
public class ProxyInfo {
String proxyHost;
int proxyPort = -1;
String socksProxyHost;
int socksProxyPort = -1;
public ProxyInfo(String pinfo) {
this(pinfo, null);
}
public ProxyInfo(String pinfo, String spinfo) {
// handle HTTP proxy settings
// accepted format is http://somehost.somedomain.com:port
if (pinfo != null)
{
int i = pinfo.indexOf("//");
// XXX: should I do smth meaningful with protocol
if (i >= 0) pinfo = pinfo.substring(i + 2);
i = pinfo.indexOf(":");
if (i < 0)
{
proxyHost = pinfo;
proxyPort = 3128; // or 80?
}
else
{
proxyHost = pinfo.substring(0, i);
try {
proxyPort = Integer.parseInt(pinfo.substring(i + 1));
} catch (NumberFormatException e) {
proxyPort = 3128;
}
}
}
// handle SOCKS proxy settings
// accepted format is host:port
if (spinfo != null)
{
int i = spinfo.indexOf(":");
if (i < 0)
{
socksProxyHost = spinfo;
socksProxyPort = 1080;
}
else
{
socksProxyHost = spinfo.substring(0, i);
try {
socksProxyPort
= Integer.parseInt(spinfo.substring(i + 1));
} catch (NumberFormatException e) {
socksProxyPort = 1080;
}
}
}
}
public ProxyInfo(String proxy, int port) {
this(proxy, port, null, -1);
}
public ProxyInfo(String proxy, int port, String socksProxy, int socksPort)
{
this.proxyHost = proxy;
this.proxyPort = port;
this.socksProxyHost = socksProxy;
this.socksProxyPort = socksPort;
}
public String getProxy() {
return proxyHost;
}
public int getPort() {
return proxyPort;
}
public String getSocksProxy() {
return socksProxyHost;
}
public int getSocksPort() {
return socksProxyPort;
}
public boolean isProxyUsed() {
return (proxyHost != null || socksProxyHost != null);
}
public boolean isSocksUsed() {
return (socksProxyHost != null);
}
}

View File

@@ -1,38 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: ProxyType.java,v 1.1 2001-07-12 20:25:57 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.applet;
public interface ProxyType {
/**
* Proxy config type
**/
public static final int PROXY_TYPE_NO_PROXY = 0;
public static final int PROXY_TYPE_MANUAL = 1;
public static final int PROXY_TYPE_AUTOCONFIG = 2;
}

View File

@@ -1,40 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: WFAppletClassLoader.java,v 1.1 2001-07-12 20:25:57 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.applet;
import sun.applet.*;
import java.net.*;
import java.security.*;
import java.io.*;
public class WFAppletClassLoader extends AppletClassLoader
{
private URL base;
public WFAppletClassLoader(URL base) {
super(base);
this.base = base;
}
};

View File

@@ -1,190 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: WFAppletContext.java,v 1.1 2001-07-12 20:25:58 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.applet;
import java.applet.*;
import java.util.*;
import sun.applet.*;
import java.awt.*;
import java.net.*;
import java.io.*;
import java.lang.reflect.*;
import sun.awt.image.URLImageSource;
public abstract class WFAppletContext implements AppletContext
{
public AudioClip getAudioClip(URL url) {
System.getSecurityManager().checkConnect(url.getHost(), url.getPort());
synchronized (audioClips) {
// first try cached data
AudioClip clip = (AudioClip)getFromCache(audioClips, url);
if (clip == null) {
clip = new AppletAudioClip(url);
putToCache(audioClips, url, clip);
}
return clip;
}
}
public Image getImage(URL url) {
System.getSecurityManager().checkConnect(url.getHost(), url.getPort());
synchronized (images) {
// first try cached data
Image img = (Image)getFromCache(images, url);
if (img == null) {
img =
Toolkit.getDefaultToolkit().createImage(new URLImageSource(url));;
putToCache(images, url, img);
}
return img;
}
}
public Applet getApplet(String name) {
name = name.toLowerCase();
for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
AppletPanel p = (AppletPanel)e.nextElement();
String param = p.getParameter("name");
if (param != null) {
param = param.toLowerCase();
}
if (name.equals(param) &&
p.getDocumentBase().equals(appletPanel.getDocumentBase())) {
try {
if (!checkConnect(appletPanel.getCodeBase().getHost(),
p.getCodeBase().getHost()))
return null;
} catch (InvocationTargetException ee) {
showStatus(ee.getTargetException().getMessage());
return null;
} catch (Exception ee) {
showStatus(ee.getMessage());
return null;
}
return p.getApplet();
}
}
return null;
}
public Enumeration getApplets() {
Vector v = new Vector();
for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
AppletPanel p = (AppletPanel)e.nextElement();
if (p.getDocumentBase().equals(appletPanel.getDocumentBase())) {
try {
checkConnect(appletPanel.getCodeBase().getHost(),
p.getCodeBase().getHost());
v.addElement(p.getApplet());
} catch (InvocationTargetException ee) {
showStatus(ee.getTargetException().getMessage());
} catch (Exception ee) {
showStatus(ee.getMessage());
}
}
}
return v.elements();
}
private boolean checkConnect(String sourceHostName, String targetHostName)
throws SecurityException, InvocationTargetException, Exception
{
SocketPermission panelSp =
new SocketPermission(sourceHostName,
"connect");
SocketPermission sp =
new SocketPermission(targetHostName,
"connect");
if (panelSp.implies(sp)) {
return true;
}
return false;
}
// separate methods to easily work around situation when weak refs
// not accesible
Object getFromCache(Hashtable cache,
Object key)
{
Object result = null;
try {
java.lang.ref.WeakReference ref =
(java.lang.ref.WeakReference)cache.get(key);
if (ref != null) result = ref.get();
} catch (Exception e) {
// if no weak refs - use cache what gives memory impact
result = cache.get(key);
}
return result;
}
void putToCache(Hashtable cache,
Object key,
Object value)
{
try {
cache.put(key, new java.lang.ref.WeakReference(value));
} catch (Exception e) {
// if no weak refs - use cache what gives memory impact
cache.put(key, value);
}
}
abstract public void showDocument(URL url);
abstract public void showDocument(URL url, String target);
abstract public void showStatus(String status);
public void addAppletInContext(AppletPanel appletPanel) {
this.appletPanel = appletPanel;
appletPanels.addElement(appletPanel);
}
public void removeAppletFromContext(AppletPanel applet) {
appletPanels.removeElement(applet);
}
public java.util.Iterator getStreamKeys() {
return null;
}
public java.io.InputStream getStream(String s) {
return null;
}
public void setStream(String s, java.io.InputStream str) {
}
private AppletPanel appletPanel;
private static Vector appletPanels = new Vector();
private static Hashtable audioClips = new Hashtable();
private static Hashtable images = new Hashtable();
}

View File

@@ -1,61 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: WFAppletSecurityManager.java,v 1.1 2001-07-12 20:26:00 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
/**
* this class created for 3 reasons:
* - to hide from extension developers sun.applet.* classes
* - to give extension developers basic point for security decisions, like
* security code can do:
* sm = System.getSecurityManager();
* if (sm instanceof sun.jvmp.applet.WFAppletSecurityManager)
* {
* Class[] clazz = mgr.getExecutionStackContext();
* and return codesource properly
* }
* - to allow fix bugs in sun.applet.* security manager
**/
package sun.jvmp.applet;
import java.security.*;
public class WFAppletSecurityManager extends sun.applet.AppletSecurity {
public WFAppletSecurityManager() {
}
public Class[] getExecutionStackContext()
{
return super.getClassContext();
}
}

View File

@@ -1,69 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: WFAppletViewer.java,v 1.1 2001-07-12 20:26:01 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.applet;
import java.net.URL;
import java.awt.Frame;
import java.applet.Applet;
/**
* interface to be implemented by different applet viewer implementation
**/
public interface WFAppletViewer
{
/**
* applet lifetime control
**/
public void startApplet();
public void stopApplet();
// timeout is time allowed for applet to complete its shutdown
// after all it just got destroyed
public void destroyApplet(int timeout);
/**
* Returns current status of applet loading, possible values - see below
**/
public int getLoadingStatus();
/**
* Get currently viewed object
*/
public Applet getApplet();
/**
* two methods to be used to supply applet with
* rendering context and real document base later than it created.
* Applet viewer shouldn't try to start applet before both are supplied.
**/
public void setDocumentBase(URL docbase);
public void setWindow(Frame f);
public final static String CID = "@sun.com/wf/applets/appletviewer;1";
public final static int STATUS_STARTED = 1;
public final static int STATUS_ERROR = 2;
public final static int STATUS_UNKNOWN = 3;
public final static int STATUS_LOADING = 4;
public final static int STATUS_STOPPED = 5;
};

View File

@@ -1,101 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: AVClassLoader.java,v 1.1 2001-07-12 20:26:04 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.av;
import java.net.URL;
import sun.applet.*;
import java.net.*;
import java.security.*;
import java.io.*;
import java.util.Enumeration;
public class AVClassLoader extends sun.jvmp.applet.WFAppletClassLoader
{
private URL base;
public AVClassLoader(URL base) {
super(base);
this.base = base;
}
/* this code is workaround for subtle bug/feature in JDK1.3.1 and 1.4,
related to loading applets behind proxy */
protected PermissionCollection getPermissions(CodeSource codesource)
{
PermissionCollection sysPerms = null;
Policy policy = (Policy)
AccessController.doPrivileged(
new PrivilegedAction() {
public Object run()
{
return Policy.getPolicy();
}});
if (policy != null)
sysPerms = policy.getPermissions(new CodeSource(null, null));
else
sysPerms = new Permissions();
final PermissionCollection perms = sysPerms;
if (base != null && base.getHost() != null)
perms.add(new SocketPermission(base.getHost()+":1-",
"accept,connect,resolve"));
URL url = codesource.getLocation();
if (url.getProtocol().equals("file")) {
String path = url.getFile().replace('/', File.separatorChar);
if (!path.endsWith(File.separator)) {
int endIndex = path.lastIndexOf(File.separatorChar);
if (endIndex != -1) {
path = path.substring(0, endIndex+1) + "-";
perms.add(new FilePermission(path, "read"));
}
}
perms.add(new SocketPermission("localhost", "connect,accept"));
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
try {
String host = InetAddress.getLocalHost().getHostName();
perms.add(new SocketPermission(host,"connect,accept"));
} catch (UnknownHostException uhe) {
}
return null;
}
});
if (base.getProtocol().equals("file")) {
String bpath = base.getFile().replace('/', File.separatorChar);
if (bpath.endsWith(File.separator)) {
bpath += "-";
}
perms.add(new FilePermission(bpath, "read"));
}
}
//for (Enumeration e=perms.elements();e.hasMoreElements();)
// System.err.println("p="+e.nextElement());
return perms;
}
};

View File

@@ -1,171 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: AVFactory.java,v 1.1 2001-07-12 20:26:05 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.av;
import sun.jvmp.*;
import sun.jvmp.applet.*;
import java.util.*;
import java.security.*;
import java.net.*;
import java.awt.Frame;
import java.applet.Applet;
public class AVFactory implements sun.jvmp.ObjectFactory
{
Vector cids;
Hashtable permsHash;
Permissions permsForAll;
boolean inited=false;
CodeSource codesource;
PluggableJVM jvm;
static AVFactory instance = null;
public static ObjectFactory getFactory(PluggableJVM jvm,
CodeSource codesource)
throws ComponentException
{
if (instance == null)
instance = new AVFactory(jvm, codesource);
return instance;
}
protected AVFactory(PluggableJVM jvm, CodeSource codesource)
throws ComponentException
{
cids = new Vector();
cids.addElement(WFAppletViewer.CID);
permsHash = new Hashtable();
this.jvm = jvm;
this.codesource = codesource;
// XXX: rewrite with policy file
permsForAll = new Permissions();
permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.av"));
permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.av.protocol.http"));
permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.av.protocol.ftp"));
permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.av.protocol.jar"));
permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.av.protocol.https"));
permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.av.protocol.gopher"));
jvm.registerProtocolHandlers(this.getClass().getClassLoader(), "sun.jvmp.av.protocol");
}
public String getName()
{
return "Waterfall applet viewer";
}
public Enumeration getCIDs()
{
return cids.elements();
}
public boolean handleConflict(String cid,
ObjectFactory f)
{
return true;
}
public Object instantiate(String cid, Object arg)
{
AppletViewerArgs a;
try {
a = (AppletViewerArgs)arg;
} catch (ClassCastException e) {
return null;
}
initEnvironment(a.support);
if ((cid == null) || (!WFAppletViewer.CID.equals(cid)) || (a == null))
return null;
return new WFAppletViewerImpl(a.jvm, a.ctx, a.support, a.atts);
}
public PermissionCollection getPermissions(CodeSource codesource)
{
// pity, but no clone() here
Permissions p = new Permissions();
for (Enumeration e=permsForAll.elements(); e.hasMoreElements(); )
p.add((Permission)e.nextElement());
if (codesource != null && codesource.getLocation() != null)
{
Permissions p1 = (Permissions)permsHash.get(codesource);
if (p1 != null)
{
for (Enumeration e=p1.elements(); e.hasMoreElements(); )
p.add((Permission)e.nextElement());
}
}
return p;
}
void initEnvironment(BrowserSupport support)
{
if (inited) return;
Properties props = new Properties(System.getProperties());
props.put("browser", "sun.jvmp");
props.put("browser.vendor", "Sun Microsystems Inc.");
props.put("http.agent", "Waterfall Applet Viewer/1.0");
props.put("package.restrict.access.sun", "true");
props.put("package.restrict.access.netscape", "false");
props.put("package.restrict.definition.java", "true");
props.put("package.restrict.definition.sun", "true");
props.put("package.restrict.definition.netscape", "true");
props.put("java.version.applet", "true");
props.put("java.vendor.applet", "true");
props.put("java.vendor.url.applet", "true");
props.put("java.class.version.applet", "true");
props.put("os.name.applet", "true");
props.put("os.version.applet", "true");
props.put("os.arch.applet", "true");
props.put("file.separator.applet", "true");
props.put("path.separator.applet", "true");
props.put("line.separator.applet", "true");
System.setProperties(props);
ProxyHandler handler
= getDefaultProxyHandler(ProxyType.PROXY_TYPE_AUTOCONFIG,
null,
null,
support);
try {
WFProxyHandler.setDefaultProxyHandler(handler);
Authenticator.setDefault(new WFAuthenticatorImpl());
} catch(Throwable e) {
PluggableJVM.trace(e, PluggableJVM.LOG_WARNING);
}
}
protected static ProxyHandler
getDefaultProxyHandler(int proxyType,
String proxyList,
String proxyOverride,
BrowserSupport ctx)
{
return new WFProxyHandler(proxyType,
proxyList,
proxyOverride,
ctx);
}
}

View File

@@ -1,366 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: WFAppletPanel.java,v 1.1 2001-07-12 20:26:06 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.av;
import java.applet.*;
import sun.applet.*;
import java.net.URL;
import java.net.MalformedURLException;
import java.util.*;
import java.awt.*;
import sun.jvmp.*;
import sun.jvmp.applet.*;
import java.io.IOException;
// wrapper for JDK's applet viewer implementation
public class WFAppletPanel extends AppletPanel implements ProxyType
{
PluggableJVM jvm;
Frame viewFrame;
int width;
int height;
URL documentURL;
URL baseURL;
WFAppletContext appletContext;
protected Hashtable atts;
private boolean inited = false;
private String myJars;
public WFAppletPanel(PluggableJVM jvm,
WFAppletContext appletContext,
Hashtable atts)
{
if (appletContext == null)
throw new IllegalArgumentException("AppletContext");
this.atts = atts;
this.jvm = jvm;
this.appletContext = appletContext;
appletContext.addAppletInContext(this);
}
public void init()
{
super.init();
sendEvent(APPLET_LOAD);
sendEvent(APPLET_INIT);
}
public void appletStart()
{
if (inited) sendEvent(APPLET_START);
}
public void appletStop()
{
sendEvent(APPLET_STOP);
}
public int getLoadingStatus()
{
switch (status)
{
case APPLET_START:
return WFAppletViewer.STATUS_STARTED;
case APPLET_STOP:
return WFAppletViewer.STATUS_STOPPED;
case APPLET_ERROR:
return WFAppletViewer.STATUS_ERROR;
case APPLET_LOAD:
return WFAppletViewer.STATUS_LOADING;
default:
return WFAppletViewer.STATUS_UNKNOWN;
}
}
public void onClose(final int timeOut)
{
appletContext.removeAppletFromContext(this);
Thread killer = new Thread(new Runnable() {
public void run() {
if (status==APPLET_LOAD) stopLoading();
sendEvent(APPLET_STOP);
sendEvent(APPLET_DESTROY);
sendEvent(APPLET_DISPOSE);
sendEvent(APPLET_QUIT);
}
});
killer.start();
}
public URL getDocumentBase()
{
return documentURL;
}
public void setDocumentBase(URL url)
{
documentURL = url;
initCodebase();
tryToInit();
}
public int getWidth()
{
String w = getParameter("width");
if (w != null) return Integer.valueOf(w).intValue();
return 0;
}
public int getHeight()
{
String h = getParameter("height");
if (h != null) return Integer.valueOf(h).intValue();
return 0;
}
public String getSerializedObject()
{
return null;
}
public String getJarFiles()
{
return myJars;
}
public String getParameter(String name) {
name = name.toLowerCase();
if (atts.get(name) != null) {
return (String) atts.get(name);
} else {
String value=null;
try {
value = getParameterFromHTML(name);
} catch (Throwable e) {
jvm.trace(e, PluggableJVM.LOG_WARNING);
}
if (value != null)
atts.put(name.toLowerCase(), value);
return value;
}
}
public Hashtable getParameters()
{
return (Hashtable) atts.clone();
}
public URL getCodeBase()
{
return baseURL;
}
public String getCode()
{
String code = getParameter("java_code");
if (code==null)
code=getParameter("code");
return code;
}
public AppletContext getAppletContext()
{
return appletContext;
}
public void setParameter(String name, Object value) {
name = name.toLowerCase();
atts.put(name, value.toString());
}
public void setWindow(Frame f)
{
if (f == null)
{
// maybe create new top level Frame
jvm.trace("Got zero Frame for SetWindow",
PluggableJVM.LOG_ERROR);
return;
}
f.setLayout(null);
Applet a = getApplet();
if (a == null) {
try {
int wd = Integer.parseInt(getParameter("width"));
int ht = Integer.parseInt(getParameter("height"));
this.width = wd;
this.height = ht;
} catch (NumberFormatException e) {
setParameter("width", new Integer(width));
setParameter("height", new Integer(height));
}
} else {
setParameter("width", new Integer(width));
setParameter("height", new Integer(height));
setSize(width, height);
a.resize(width, height);
a.setVisible(true);
}
setBounds(0, 0, width, height);
if (this.viewFrame == f) return;
this.viewFrame = f;
f.add(this);
f.show();
f.setBounds(0, 0, width, height);
tryToInit();
}
public void paint(Graphics g)
{
if (getApplet() == null && g != null) {
setBackground(Color.lightGray);
g.setColor(Color.black);
Dimension d = getSize();
Font fontOld = g.getFont();
FontMetrics fm = null;
if (fontOld != null)
fm = g.getFontMetrics(fontOld);
String str = getStatusString();;
// Display message on the screen if the applet is not started yet.
if (d != null && fm != null)
g.drawString(str, (d.width - fm.stringWidth(str))/ 2,
(d.height + fm.getAscent())/ 2);
}
}
protected String getParameterFromHTML(String name)
{
return null;
}
protected void loadJarFiles(AppletClassLoader loader)
throws IOException, InterruptedException
{
// Cache option as read from the Html page tag
String copt;
// Cache Archive value as read from the Html page tag
String carch;
// Cache Version value as read from the Html page tag
String cver;
// Vector to store the names of the jar files to be cached
Vector jname = new Vector();
// Vector to store actual version numbers
Vector jVersion = new Vector();
// Figure out the list of all required JARs.
String raw = getParameter("java_archive");
if (raw == null)
{
raw = getParameter("archive");
}
// no jars required
if (raw == null)
{
return;
}
myJars = raw;
super.loadJarFiles(loader);
return;
}
protected AppletClassLoader createClassLoader(final URL codebase)
{
return new AVClassLoader(codebase);
}
private String getStatusString()
{
switch (status)
{
case APPLET_START:
return "Applet started.";
case APPLET_STOP:
return "Applet stopped.";
case APPLET_ERROR:
return "Error loading applet.";
case APPLET_LOAD:
return "WF loading applet...";
default:
// just for user's convinience ;)
return "loading applet...";
//return "Unknown status";
}
}
private void tryToInit() {
//jvm.trace("tryToInit()", PluggableJVM.LOG_DEBUG);
if (!inited && viewFrame != null && getDocumentBase() != null)
{
inited = true;
Thread starter = new Thread(new Runnable() {
public void run() {
//jvm.trace("real Init()", PluggableJVM.LOG_DEBUG);
init();
sendEvent(APPLET_START);
}
});
starter.start();
}
}
private void initCodebase()
{
String att = getParameter("java_codebase");
if (att == null) att = getParameter("codebase");
if (att != null) {
if (!att.endsWith("/")) att += "/";
try {
baseURL = new URL(documentURL, att);
} catch (MalformedURLException e) {
}
}
if (baseURL == null) {
String file = documentURL.getFile();
int i = file.lastIndexOf('/');
if (i > 0 && i < file.length() - 1) {
try {
baseURL = new URL(documentURL, file.substring(0, i + 1));
} catch (MalformedURLException e) {
}
}
}
if (baseURL == null) baseURL = documentURL;
}
}

View File

@@ -1,83 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: WFAppletViewerImpl.java,v 1.1 2001-07-12 20:26:07 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.av;
import sun.jvmp.*;
import sun.jvmp.applet.*;
import java.util.Hashtable;
import java.applet.*;
import java.net.URL;
import java.awt.Frame;
class WFAppletViewerImpl implements WFAppletViewer
{
WFAppletPanel av;
WFAppletViewerImpl(PluggableJVM jvm,
WFAppletContext ctx,
BrowserSupport support,
Hashtable atts)
{
av = new WFAppletPanel(jvm, ctx, atts);
}
public void startApplet()
{
av.appletStart();
}
public void stopApplet()
{
av.appletStop();
}
public void destroyApplet(int timeout)
{
av.onClose(timeout);
}
public int getLoadingStatus()
{
return av.getLoadingStatus();
}
public void setDocumentBase(URL docbase)
{
av.setDocumentBase(docbase);
}
public void setWindow(Frame f)
{
av.setWindow(f);
}
public Applet getApplet()
{
return av.getApplet();
}
}

View File

@@ -1,152 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: WFAuthenticatorImpl.java,v 1.1 2001-07-12 20:26:07 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.av;
import java.net.*;
import java.security.*;
import java.awt.*;
import java.awt.event.*;
public class WFAuthenticatorImpl extends Authenticator
{
protected synchronized PasswordAuthentication getPasswordAuthentication()
{
PasswordAuthentication pass = null;
try
{
InetAddress host = getRequestingSite();
String hostName = "<<unknown>>";
if (host != null) hostName = host.toString();
pass = askUser(hostName,
getRequestingPrompt(),
getRequestingScheme());
}
catch (Exception e)
{
// do nothing here
e.printStackTrace();
}
return pass;
}
protected PasswordAuthentication askUser(String host,
String prompt,
String scheme)
{
AuthDialog dlg = new AuthDialog(host, prompt, scheme);
return dlg.askUser();
}
}
class AuthDialog extends Frame
{
TextField user;
TextField passwd;
PasswordAuthentication auth;
AuthDialog(String host,
String prompt,
String scheme)
{
super("Authentication dialog");
//System.err.println("h="+host+" p="+prompt+" s="+scheme);
setLayout(new BorderLayout());
setResizable(true);
Panel p1 = new Panel();
p1.setLayout(new BorderLayout());
user = new TextField(15);
passwd = new TextField(15);
passwd.setEchoChar('*');
p1.add(new Label("Auth request for "+host),
BorderLayout.NORTH);
p1.add(new Label(prompt), BorderLayout.SOUTH);
Panel p2 = new Panel();
p2.setLayout(new BorderLayout());
Panel p21 = new Panel();
p21.setLayout(new FlowLayout(FlowLayout.LEFT));
p21.add(new Label("Username: "));
p21.add(user);
Panel p22 = new Panel();
p22.setLayout(new FlowLayout(FlowLayout.LEFT));
p22.add(new Label("Password: "));
p22.add(passwd);
p2.add(p21, BorderLayout.NORTH);
p2.add(p22, BorderLayout.SOUTH);
Panel p3 = new Panel();
p3.setLayout(new FlowLayout(FlowLayout.CENTER));
Button ok = new Button("OK");
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
synchronized (user) {
auth = new PasswordAuthentication(user.getText(),
passwd.getText().toCharArray());
user.notify();
}
}
});
p3.add(ok);
Button cancel = new Button("Cancel");
cancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
auth = null;
synchronized (user) {
// System.err.println("u="+user.getText()+" p="+passwd.getText());
user.notify();
}
}
});
p3.add(cancel);
add(p1, BorderLayout.NORTH);
add(p3, BorderLayout.SOUTH);
add(p2, BorderLayout.CENTER);
setSize(320,180);
}
PasswordAuthentication askUser()
{
show();
try {
synchronized (user) {
user.wait();
}
} catch (InterruptedException e) {}
hide();
return auth;
}
}

View File

@@ -1,112 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: WFProxyHandler.java,v 1.1 2001-07-12 20:26:07 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.av;
import java.net.URL;
import java.util.Hashtable;
import java.util.StringTokenizer;
import sun.jvmp.*;
import sun.jvmp.applet.*;
public class WFProxyHandler implements ProxyHandler, ProxyType {
private int proxyType = PROXY_TYPE_NO_PROXY;
private String proxyList = null;
private String proxyOverride = null;
private Hashtable proxyCache = null;
private BrowserSupport support = null;
public WFProxyHandler(int proxyType,
String proxyList,
String proxyOverride,
BrowserSupport sup)
{
this.proxyType = proxyType;
this.proxyList = proxyList;
this.proxyOverride = proxyOverride;
this.support = sup;
// XXX: implement me
if (proxyType == PROXY_TYPE_MANUAL)
{
PluggableJVM.trace("Manual proxy config not supported yet",
PluggableJVM.LOG_ERROR);
}
proxyCache = new Hashtable();
}
public synchronized ProxyInfo getProxyInfo(URL u)
{
ProxyInfo pinfo = null;
try {
pinfo = (ProxyInfo) proxyCache.get(u.getProtocol()
+ u.getHost()
+ u.getPort());
// currently the only way to get proxy is to ask it from browser
if (pinfo != null)
return pinfo;
if (support == null)
pinfo = null;
else
pinfo = support.getProxyInfoForURL(u);
proxyCache.put(u.getProtocol() + u.getHost() + u.getPort(), pinfo);
}
catch (Exception e) {
PluggableJVM.trace("Proxy is not configured",
PluggableJVM.LOG_ERROR);
PluggableJVM.trace(e, PluggableJVM.LOG_ERROR);
pinfo = new ProxyInfo(null, -1);
}
return pinfo;
}
// The current default proxy handler
private static ProxyHandler handler;
public static ProxyHandler getDefaultProxyHandler()
{
return handler;
}
public static void setDefaultProxyHandler(ProxyHandler newDefault)
{
handler = newDefault;
}
}

View File

@@ -1,43 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: Handler.java,v 1.1 2001-07-12 20:26:09 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.av.protocol.http;
import java.net.*;
import java.io.IOException;
public class Handler extends sun.net.www.protocol.http.Handler
{
public URLConnection openConnection(URL u)
throws IOException
{
return new HttpURLConnection(u, this);
}
}

View File

@@ -1,102 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: HttpURLConnection.java,v 1.1 2001-07-12 20:26:11 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.av.protocol.http;
import java.io.*;
import java.util.*;
import java.security.*;
import sun.net.*;
import java.net.*;
import sun.net.www.*;
import sun.jvmp.applet.*;
import sun.jvmp.av.*;
class HttpURLConnection extends sun.net.www.protocol.http.HttpURLConnection
{
protected String proxy = null;
protected int proxyPort = -1;
public HttpURLConnection(URL u, Handler handler)
throws IOException
{
super(u, handler);
ProxyHandler p = WFProxyHandler.getDefaultProxyHandler();
ProxyInfo pi = (p != null) ? p.getProxyInfo(u) : null;
if (pi != null)
{
this.proxy = pi.getProxy();
this.proxyPort = pi.getPort();
//System.err.println("for url="+url+" proxy="+proxy);
}
}
public synchronized void connect()
throws IOException
{
if (connected) return;
try {
AccessController.doPrivileged(new PrivilegedExceptionAction()
{
public Object run() throws IOException {
http = new sun.net.www.http.HttpClient(url, proxy, proxyPort);
ps = (PrintStream)http.getOutputStream();
return null;
}
});
} catch (PrivilegedActionException e) {
IOException ioe = (IOException)e.getException();
System.err.println("rethrown security exception");
throw ioe;
}
connected = true;
}
public synchronized InputStream getInputStream()
throws IOException
{
if (!connected) connect();
return super.getInputStream();
}
public Permission getPermission() throws IOException
{
if (proxy != null)
{
return new java.net.SocketPermission(proxy+":"+proxyPort,
"connect,accept,resolve");
}
return null;
}
}

View File

@@ -1,103 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: GenericSynchroObject.java,v 1.2 2001-07-12 19:57:56 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.generic;
import sun.jvmp.*;
public abstract class GenericSynchroObject extends SynchroObject
{
protected long m_handle = 0;
protected boolean m_state = false;
public void _lock()
{
int res;
if (!m_state)
throw new IllegalMonitorStateException("Invalid object state");
if ((res = doLock(m_handle)) != 0)
throw new IllegalMonitorStateException("Invalid native state: err="
+res);
}
public void _unlock()
{
int res;
if (!m_state)
throw new IllegalMonitorStateException("Invalid object state");
if ((res=doUnlock(m_handle)) != 0)
throw new IllegalMonitorStateException("Invalid native state: err="
+res);
}
public void _wait(int milli) throws InterruptedException
{
int res;
if (!m_state)
throw new IllegalMonitorStateException("Invalid object state");
if ((res = doWait(m_handle, milli)) < -1)
throw new IllegalMonitorStateException("Invalid native state: err="
+res);
if (res == -1) throw new InterruptedException("Native wait() interrupted");
}
public void _notify()
{
int res;
if (!m_state)
throw new IllegalMonitorStateException("Invalid object state");
if ((res=doNotify(m_handle)) != 0)
throw new IllegalMonitorStateException("Invalid native state: err="
+res);
}
public void _notifyAll()
{
int res;
if (!m_state)
throw new IllegalMonitorStateException("Invalid object state");
if ((res=doNotifyAll(m_handle)) != 0)
throw new IllegalMonitorStateException("Invalid native state: err="
+res);
}
public void _destroy()
{
int res;
if (!m_state)
throw new IllegalMonitorStateException("Invalid object state");
if ((res=doDestroy(m_handle)) != 0)
throw new IllegalMonitorStateException("Invalid native state: err="
+res);
}
protected abstract int checkHandle(long handle);
protected abstract int doLock(long handle);
protected abstract int doUnlock(long handle);
protected abstract int doWait(long handle, int milli);
protected abstract int doNotify(long handle);
protected abstract int doNotifyAll(long handle);
protected abstract int doDestroy(long handle);
};

View File

@@ -1,123 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: Plugin.java,v 1.2 2001-07-12 19:57:58 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
// XXX: this class depends on sun.awt.*
package sun.jvmp.generic.motif;
import sun.jvmp.*;
import java.awt.*;
public class Plugin extends PluggableJVM
{
static Plugin real_instance = null;
protected Plugin()
{
super();
instance = this;
};
protected static PluggableJVM startJVM(String codebase, int debug)
{
debugLevel = debug;
// for now, only one instance of JVM is allowed - can be fixed easily
if (real_instance == null)
{
real_instance = new Plugin();
// don't do nothing until init is complete
real_instance.init(codebase, true);
real_instance.start();
};
return real_instance;
};
protected NativeFrame SysRegisterWindow(int handle,
int width, int height)
{
NativeFrame nf;
if (!initedNative)
{
loadLibrary();
}
long widget = getWidget(handle, width, height, 0, 0);
Frame f = createEmbeddedFrame(widget);
if (f == null)
{
trace("Creation of frame failed", LOG_ERROR);
return null;
}
f.setBounds(0, 0, width, height);
f.setResizable(false);
nf = new NativeFrame(f);
return nf;
}
protected NativeFrame SysUnregisterWindow(int id)
{
NativeFrame nf = (NativeFrame)nativeFrames.get(id);
if (nf == null) return null;
Frame f = nf.getFrame();
f.removeAll();
f.removeNotify();
return nf;
};
protected SynchroObject SysRegisterMonitorObject(long handle)
{
SynchroObject so = null;
try {
so = new PthreadSynchroObject(handle);
} catch (Exception e) {
trace("SysRegisterMonitorObject failed: "+e, LOG_ERROR);
return null;
}
return so;
}
protected SynchroObject SysUnregisterMonitorObject(int id)
{
SynchroObject so = getSynchroObjectWithID(id);
if (so == null) return null;
so._destroy();
return so;
}
/*
this is a separate method as MEmbeddedFrame constructor arguments
differs in 1.1 and 1.2.
and maybe we should use reflection (like original plugin)
to call proper constructor
*/
private Frame createEmbeddedFrame(long widget)
{
return new sun.awt.motif.MEmbeddedFrame(widget);
};
static private native long getWidget(int winid, int width,
int height, int x, int y);
};

View File

@@ -1,46 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: PthreadSynchroObject.java,v 1.2 2001-07-12 19:57:58 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.generic.motif;
import sun.jvmp.generic.GenericSynchroObject;
public class PthreadSynchroObject extends GenericSynchroObject
{
public PthreadSynchroObject(long handle) throws IllegalArgumentException
{
m_handle = handle;
if (checkHandle(handle) != 0)
throw new IllegalArgumentException("Invalid handle passed to constructor");
m_state = true;
}
protected native int checkHandle(long handle);
protected native int doLock(long handle);
protected native int doUnlock(long handle);
protected native int doWait(long handle, int milli);
protected native int doNotify(long handle);
protected native int doNotifyAll(long handle);
protected native int doDestroy(long handle);
};

View File

@@ -1,113 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: Plugin.java,v 1.2 2001-07-12 19:57:59 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.generic.win32;
import sun.jvmp.*;
import java.awt.*;
public class Plugin extends PluggableJVM
{
static Plugin real_instance = null;
protected Plugin()
{
super();
instance = this;
};
protected static PluggableJVM startJVM(String codebase, int debug)
{
debugLevel = debug;
// for now, only one instance of JVM is allowed - can be fixed easily
if (real_instance == null)
{
real_instance = new Plugin();
// don't do nothing until init is complete
real_instance.init(codebase, false);
real_instance.start();
};
return real_instance;
};
protected NativeFrame SysRegisterWindow(int handle,
int width, int height)
{
NativeFrame nf;
Frame frame = createEmbeddedFrame(handle);
if (frame == null)
{
trace("Creation of frame failed", LOG_ERROR);
return null;
};
frame.setBounds(0, 0, width, height);
frame.setResizable(false);
nf = new NativeFrame(frame);
return nf;
}
protected NativeFrame SysUnregisterWindow(int id)
{
NativeFrame nf = (NativeFrame)nativeFrames.get(id);
if (nf == null) return null;
Frame f = nf.getFrame();
// XXX: hacky, but Win32 impl really throws exception here
try {
f.removeAll();
f.removeNotify();
} catch (Exception e){
trace(e, LOG_DEBUG);
}
return nf;
};
protected SynchroObject SysRegisterMonitorObject(long handle)
{
return null;
}
protected SynchroObject SysUnregisterMonitorObject(int id)
{
return null;
}
/*
this is a separate method as MEmbeddedFrame constructor arguments
differs in 1.1 and 1.2.
and maybe we should use reflection (like original plugin)
to call proper constructor
*/
private Frame createEmbeddedFrame(int handle)
{
return new sun.awt.windows.WEmbeddedFrame(handle);
};
};

View File

@@ -1,36 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: JSContext.java,v 1.1 2001-07-12 20:26:14 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.javascript;
/**
* Interface to be implemented by applet context if it likes to
* provide LiveConnect functionality
**/
public interface JSContext {
netscape.javascript.JSObject getJSObject();
}

View File

@@ -1,373 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: JSObject.java,v 1.1 2001-07-18 20:48:17 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package sun.jvmp.mozilla;
import sun.jvmp.PluggableJVM;
import sun.jvmp.applet.*;
import java.security.*;
import netscape.javascript.JSException;
import java.net.URL;
public class JSObject extends netscape.javascript.JSObject {
private int nativeJSObject = 0;
private int jsThreadID = 0;
private long m_params = 0;
/* this field used to perform static calls - it is inited from constructor
of MozillaPeerFactory with pointer to BrowserSupportWrapper */
static long m_evaluator = 0;
// just for reflection
JSObject(Long params) {
this(params.longValue());
}
JSObject(long params) {
this(JSGetThreadID(params), JSGetNativeJSObject(params));
m_params = params;
}
JSObject(int jsThreadID, int nativeJSObject) {
this.jsThreadID = jsThreadID;
this.nativeJSObject = nativeJSObject;
}
public Object call(String methodName,
Object args[])
throws JSException
{
WFSecurityContext ctx = WFSecurityContext.getCurrentSecurityContext();
return JSObjectCall(jsThreadID,
nativeJSObject,
m_params,
ctx.getURL(),
ctx.getCertChain(),
ctx.getCertLength(),
ctx.getNumOfCert(),
methodName, args,
ctx.getAccessControlContext());
}
public Object eval(String s) throws JSException
{
WFSecurityContext ctx = WFSecurityContext.getCurrentSecurityContext();
return JSObjectEval(jsThreadID,
nativeJSObject,
m_params,
ctx.getURL(),
ctx.getCertChain(),
ctx.getCertLength(),
ctx.getNumOfCert(),
s,
ctx.getAccessControlContext());
}
public Object getMember(String name) throws JSException
{
WFSecurityContext ctx = WFSecurityContext.getCurrentSecurityContext();
return JSObjectGetMember(jsThreadID,
nativeJSObject,
m_params,
ctx.getURL(),
ctx.getCertChain(),
ctx.getCertLength(),
ctx.getNumOfCert(),
name,
ctx.getAccessControlContext());
}
public void setMember(String name, Object value) throws JSException
{
WFSecurityContext ctx = WFSecurityContext.getCurrentSecurityContext();
JSObjectSetMember(jsThreadID,
nativeJSObject,
m_params,
ctx.getURL(),
ctx.getCertChain(),
ctx.getCertLength(),
ctx.getNumOfCert(),
name,
value,
ctx.getAccessControlContext());
}
public void removeMember(String name) throws JSException
{
WFSecurityContext ctx = WFSecurityContext.getCurrentSecurityContext();
JSObjectRemoveMember(jsThreadID,
nativeJSObject,
m_params,
ctx.getURL(),
ctx.getCertChain(),
ctx.getCertLength(),
ctx.getNumOfCert(),
name,
ctx.getAccessControlContext());
}
public Object getSlot(int index) throws JSException
{
WFSecurityContext ctx = WFSecurityContext.getCurrentSecurityContext();
return JSObjectGetSlot(jsThreadID,
nativeJSObject,
m_params,
ctx.getURL(),
ctx.getCertChain(),
ctx.getCertLength(),
ctx.getNumOfCert(),
index,
ctx.getAccessControlContext());
}
public void setSlot(int index, Object value) throws JSException
{
WFSecurityContext ctx = WFSecurityContext.getCurrentSecurityContext();
JSObjectSetSlot(jsThreadID,
nativeJSObject,
m_params,
ctx.getURL(),
ctx.getCertChain(),
ctx.getCertLength(),
ctx.getNumOfCert(),
index,
value,
ctx.getAccessControlContext());
}
public String toString()
{
return JSObjectToString(jsThreadID, nativeJSObject, m_params);
}
public void finalize()
throws Throwable
{
JSFinalize(jsThreadID, nativeJSObject, m_params);
super.finalize();
}
private static int JSGetNativeJSObject(long params)
{
WFSecurityContext ctx = WFSecurityContext.getCurrentSecurityContext();
return JSGetNativeJSObject(params,
ctx.getURL(),
ctx.getCertChain(),
ctx.getCertLength(),
ctx.getNumOfCert(),
ctx.getAccessControlContext());
}
private static native int JSGetNativeJSObject(long params,
String url,
byte[][] chain,
int[] certLength,
int numOfCerts,
AccessControlContext ctx);
private static native int JSGetThreadID(long params);
private static native void JSFinalize(int jsThreadID,
int nativeJSObject,
long params);
private static native Object JSObjectCall(int jsThreadID,
int nativeJSObject,
long params,
String url,
byte[][] chain,
int[] certLength, int numOfCerts,
String methodName,
Object args[],
AccessControlContext ctx)
throws JSException;
private static native Object JSObjectEval(int jsThreadID,
int nativeJSObject,
long params,
String url,
byte[][] chain,
int[] certLength,
int numOfCerts,
String script,
AccessControlContext ctx)
throws JSException;
private static native Object JSObjectGetMember(int jsThreadID,
int nativeJSObject,
long params,
String url,
byte[][] chain,
int[] certLength,
int numOfCerts,
String name,
AccessControlContext ctx)
throws JSException;
private static native void JSObjectSetMember(int jsThreadID,
int nativeJSObject,
long params,
String url,
byte[][] chain,
int[] certLength,
int numOfCerts,
String name,
Object value,
AccessControlContext ctx)
throws JSException;
private static native void JSObjectRemoveMember(int jsThreadID,
int nativeJSObject,
long params,
String url,
byte[][] chain,
int[] certLength,
int numOfCerts,
String name,
AccessControlContext ctx)
throws JSException;
private static native Object JSObjectGetSlot(int jsThreadID,
int nativeJSObject,
long params,
String url,
byte[][] chain,
int[] certLength,
int numOfCerts,
int index,
AccessControlContext ctx)
throws JSException;
private static native void JSObjectSetSlot(int jsThreadID,
int nativeJSObject,
long params,
String url,
byte[][] chain,
int[] certLength,
int numOfCerts,
int index,
Object value,
AccessControlContext ctx)
throws JSException;
private static native String JSObjectToString(int jsThreadID,
int nativeJSObject,
long params);
}
class WFSecurityContext
{
private ProtectionDomain domain;
private AccessControlContext ctx;
WFSecurityContext(ProtectionDomain domain, AccessControlContext ctx)
{
this.domain = domain;
this.ctx = ctx;
}
String getURL()
{
if (domain != null)
{
CodeSource src = domain.getCodeSource();
URL u = src.getLocation();
if (u != null) return u.toString();
}
return null;
}
byte[][] getCertChain()
{
return null;
}
int[] getCertLength()
{
return null;
}
int getNumOfCert()
{
return 0;
}
AccessControlContext getAccessControlContext()
{
return ctx;
}
static WFSecurityContext getCurrentSecurityContext()
{
final AccessControlContext ctx = AccessController.getContext();
try {
return (WFSecurityContext)
AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws PrivilegedActionException
{
SecurityManager sm = System.getSecurityManager();
// do anything only if installed SM is subclass
// of our applet security manager
if (sm != null && sm instanceof sun.jvmp.applet.WFAppletSecurityManager)
{
WFAppletSecurityManager m = (WFAppletSecurityManager)sm;
Class[] stack = m.getExecutionStackContext();
for (int i=0; i < stack.length; i++)
{
ClassLoader loader = stack[i].getClassLoader();
if (loader !=null &&
loader instanceof sun.jvmp.applet.WFAppletClassLoader)
return new WFSecurityContext(stack[i].getProtectionDomain(),
ctx);
}
}
return new WFSecurityContext(null, ctx);
}
});
} catch (PrivilegedActionException e) {
PluggableJVM.trace(e, PluggableJVM.LOG_WARNING);
return new WFSecurityContext(null, ctx);
}
}
}

Some files were not shown because too many files have changed in this diff Show More