changeset in /hg/icedtea: Update plugin and javaws.
Andrew John Hughes
ahughes at redhat.com
Wed May 20 13:31:07 PDT 2009
changeset 8dc304404e01 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=8dc304404e01
description:
Update plugin and javaws.
2009-05-13 Omair Majid <omajid at redhat.com>
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/JNLPSplashScreen.java: New file. This new class
is responsible for displaying the splash screen.
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/Launcher.java (launchApplication): Show a splash
screen if specified in the JNLP file while loading the remote jars.
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java (getListener):
Reposition the frame at the bottom right corner of the screen.
2009-05-13 Lillian Angel <langel at redhat.com>
* plugin/icedtea/sun/applet/PluginAppletSecurityContext.java
(PluginAppletSecurityContext): Added comment.
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java
(checkPermission): Fixed style.
2009-05-11 Lillian Angel <langel at redhat.com>
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPRuntime.java
(getDefaultBaseDir): Added check for home dir. Return null if homeDir
not found in system properties.
2009-05-11 Lillian Angel <langel at redhat.com>
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPRuntime.java
(getDefaultBaseDir): Added null check.
2009-05-11 Lillian Angel <langel at redhat.com>
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPRuntime.java
(getDefaultBaseDir): Set basedir for netx applications to ~/.netx,
rather than asking. Now consistant with the plugin.
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/InstallDialog.java: Removed.
2009-05-06 Lillian Angel <langel at redhat.com>
Fixes bz#498108
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/NetxPanel.java
(runLoader): Pass false to JNLPRuntime.initialize, since this is an
applet.
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java
(PluginAppletSecurityContext): Likewise.
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/Boot.java
(run): Pass true to JNLPRuntime.initialize, since this
is a webstart app.
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPRuntime.java
(initialize): Added new parameter isApplication, which is used to set
global static variable isWebstartApplication.
(isWebstartApplication): New accessor function.
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java:
(checkPermission): Added call to JNLPRuntime.isWebstartApplication so
the check is bypassed if the permissions are to be checked for
a webstart application.
2009-04-30 Deepak Bhole <dbhole at redhat.com>
* plugin/icedtea/sun/applet/PluginAppletSecurityContext.java: Forgo
permission check if JS source is [System] (i.e. Mozilla
extension/chrome).
2009-04-23 Deepak Bhole <dbhole at redhat.com>
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Handle nested
jars.
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPPolicy.java: Use site address when
checking for policy against CodeSource.
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/tools/JarSigner.java: Handle nested
jars.
2009-04-10 Deepak Bhole <dbhole at redhat.com>
* IcedTeaPlugin.cc: Fix rhbz478561 (freeze with empty string return from
Java side).
* plugin/icedtea/sun/applet/PluginMessageConsumer.java: Bump max workers
from 3 to 20, limiting initial to 3, and growing if/when needed.
2009-04-02 Deepak Bhole <dbhole at redhat.com>
* IcedTeaPlugin.cc: Incremented timeout to 3 minutes. Added functions to
process proxy and auth info requests (the latter is unused).
* plugin/icedtea/sun/applet/PasswordAuthenticationDialog.java: New file.
Displays a username/password input dialog to users for sites and proxies
requiring http auth.
* plugin/icedtea/sun/applet/PluginAppletViewer.java: Fix wait mechanism to
detect applet initialization failures correctly. Add support for
requesting proxy information from the browser.
* plugin/icedtea/sun/applet/PluginCallRequestFactory.java: Add support for
PluginProxyInfoRequest objects.
* plugin/icedtea/sun/applet/PluginMain.java: Wire in custom authenticator
and proxy selector.
* plugin/icedtea/sun/applet/PluginProxyInfoRequest.java: New file. Object
representing proxy information request from browser.
* plugin/icedtea/sun/applet/PluginProxySelector.java: Custom proxy
selector that requests information from browser and uses it.
* plugin/icedtea/sun/applet/PluginStreamHandler.java: Improve handling
code for "plugin specific" messages on the wire.
* overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/NetxPanel.java: Add support for improved
initialization failure detection.
diffstat:
22 files changed, 1096 insertions(+), 266 deletions(-)
ChangeLog | 99 ++++
IcedTeaPlugin.cc | 174 ++++++-
overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/JNLPFile.java | 2
overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/Launcher.java | 23
overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/NetxPanel.java | 11
overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java | 9
overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/Boot.java | 51 +-
overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/InstallDialog.java | 171 -------
overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 86 ++-
overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPPolicy.java | 3
overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 26 -
overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java | 23
overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/tools/JarSigner.java | 8
plugin/icedtea/sun/applet/PasswordAuthenticationDialog.java | 241 ++++++++++
plugin/icedtea/sun/applet/PluginAppletSecurityContext.java | 4
plugin/icedtea/sun/applet/PluginAppletViewer.java | 63 ++
plugin/icedtea/sun/applet/PluginCallRequestFactory.java | 4
plugin/icedtea/sun/applet/PluginMain.java | 36 +
plugin/icedtea/sun/applet/PluginMessageConsumer.java | 22
plugin/icedtea/sun/applet/PluginProxyInfoRequest.java | 85 +++
plugin/icedtea/sun/applet/PluginProxySelector.java | 195 ++++++++
plugin/icedtea/sun/applet/PluginStreamHandler.java | 26 -
diffs (truncated from 1967 to 500 lines):
diff -r bbac5c54022b -r 8dc304404e01 ChangeLog
--- a/ChangeLog Wed May 20 20:50:48 2009 +0100
+++ b/ChangeLog Wed May 20 21:17:02 2009 +0100
@@ -1,3 +1,102 @@ 2009-05-20 Andrew John Hughes <ahughes
+2009-05-13 Omair Majid <omajid at redhat.com>
+
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/JNLPSplashScreen.java: New file. This new class
+ is responsible for displaying the splash screen.
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/Launcher.java (launchApplication): Show a splash
+ screen if specified in the JNLP file while loading the remote jars.
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java (getListener):
+ Reposition the frame at the bottom right corner of the screen.
+
+2009-05-13 Lillian Angel <langel at redhat.com>
+
+ * plugin/icedtea/sun/applet/PluginAppletSecurityContext.java
+ (PluginAppletSecurityContext): Added comment.
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java
+ (checkPermission): Fixed style.
+
+2009-05-11 Lillian Angel <langel at redhat.com>
+
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPRuntime.java
+ (getDefaultBaseDir): Added check for home dir. Return null if homeDir
+ not found in system properties.
+
+2009-05-11 Lillian Angel <langel at redhat.com>
+
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPRuntime.java
+ (getDefaultBaseDir): Added null check.
+
+2009-05-11 Lillian Angel <langel at redhat.com>
+
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPRuntime.java
+ (getDefaultBaseDir): Set basedir for netx applications to ~/.netx,
+ rather than asking. Now consistant with the plugin.
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/InstallDialog.java: Removed.
+
+2009-05-06 Lillian Angel <langel at redhat.com>
+
+ Fixes bz#498108
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/NetxPanel.java
+ (runLoader): Pass false to JNLPRuntime.initialize, since this is an
+ applet.
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java
+ (PluginAppletSecurityContext): Likewise.
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/Boot.java
+ (run): Pass true to JNLPRuntime.initialize, since this
+ is a webstart app.
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPRuntime.java
+ (initialize): Added new parameter isApplication, which is used to set
+ global static variable isWebstartApplication.
+ (isWebstartApplication): New accessor function.
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java:
+ (checkPermission): Added call to JNLPRuntime.isWebstartApplication so
+ the check is bypassed if the permissions are to be checked for
+ a webstart application.
+
+2009-04-30 Deepak Bhole <dbhole at redhat.com>
+
+ * plugin/icedtea/sun/applet/PluginAppletSecurityContext.java: Forgo
+ permission check if JS source is [System] (i.e. Mozilla
+ extension/chrome).
+
+2009-04-23 Deepak Bhole <dbhole at redhat.com>
+
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Handle nested
+ jars.
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/runtime/JNLPPolicy.java: Use site address when
+ checking for policy against CodeSource.
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/tools/JarSigner.java: Handle nested
+ jars.
+
+2009-04-10 Deepak Bhole <dbhole at redhat.com>
+
+ * IcedTeaPlugin.cc: Fix rhbz478561 (freeze with empty string return from
+ Java side).
+ * plugin/icedtea/sun/applet/PluginMessageConsumer.java: Bump max workers
+ from 3 to 20, limiting initial to 3, and growing if/when needed.
+
+2009-04-02 Deepak Bhole <dbhole at redhat.com>
+
+ * IcedTeaPlugin.cc: Incremented timeout to 3 minutes. Added functions to
+ process proxy and auth info requests (the latter is unused).
+ * plugin/icedtea/sun/applet/PasswordAuthenticationDialog.java: New file.
+ Displays a username/password input dialog to users for sites and proxies
+ requiring http auth.
+ * plugin/icedtea/sun/applet/PluginAppletViewer.java: Fix wait mechanism to
+ detect applet initialization failures correctly. Add support for
+ requesting proxy information from the browser.
+ * plugin/icedtea/sun/applet/PluginCallRequestFactory.java: Add support for
+ PluginProxyInfoRequest objects.
+ * plugin/icedtea/sun/applet/PluginMain.java: Wire in custom authenticator
+ and proxy selector.
+ * plugin/icedtea/sun/applet/PluginProxyInfoRequest.java: New file. Object
+ representing proxy information request from browser.
+ * plugin/icedtea/sun/applet/PluginProxySelector.java: Custom proxy
+ selector that requests information from browser and uses it.
+ * plugin/icedtea/sun/applet/PluginStreamHandler.java: Improve handling
+ code for "plugin specific" messages on the wire.
+ * overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/NetxPanel.java: Add support for improved
+ initialization failure detection.
+
2009-05-20 Andrew John Hughes <ahughes at redhat.com>
* HACKING: Updated.
diff -r bbac5c54022b -r 8dc304404e01 IcedTeaPlugin.cc
--- a/IcedTeaPlugin.cc Wed May 20 20:50:48 2009 +0100
+++ b/IcedTeaPlugin.cc Wed May 20 21:17:02 2009 +0100
@@ -85,7 +85,7 @@ PRThread* current_thread ();
// #14 0x0153fdbf in ProxyJNIEnv::CallObjectMethod (env=0xa8b8040, obj=0x9dad690, methodID=0xa0ed070) at ProxyJNI.cpp:641
// timeout (in seconds) for various calls to java side
-#define TIMEOUT 20
+#define TIMEOUT 180
#define NOT_IMPLEMENTED() \
PLUGIN_DEBUG_1ARG ("NOT IMPLEMENTED: %s\n", __PRETTY_FUNCTION__)
@@ -588,7 +588,7 @@ char const* TYPES[10] = { "Object",
PLUGIN_DEBUG_0ARG ("RECEIVE VALUE 1\n"); \
ResultContainer *resultC; \
factory->result_map.Get(reference, &resultC); \
- while (resultC->returnValue == "" && \
+ while (resultC->returnValue.IsVoid() == PR_TRUE && \
resultC->errorOccurred == PR_FALSE) \
{ \
PROCESS_PENDING_EVENTS_REF (reference); \
@@ -607,7 +607,7 @@ char const* TYPES[10] = { "Object",
PLUGIN_DEBUG_0ARG("RECEIVE SIZE 1\n"); \
ResultContainer *resultC; \
factory->result_map.Get(reference, &resultC); \
- while (resultC->returnValue == "" && \
+ while (resultC->returnValue.IsVoid() == PR_TRUE && \
resultC->errorOccurred == PR_FALSE) \
{ \
PROCESS_PENDING_EVENTS_REF (reference); \
@@ -631,7 +631,7 @@ char const* TYPES[10] = { "Object",
PLUGIN_DEBUG_0ARG("RECEIVE STRING 1\n"); \
ResultContainer *resultC; \
factory->result_map.Get(reference, &resultC); \
- while (resultC->returnValue == "" && \
+ while (resultC->returnValue.IsVoid() == PR_TRUE && \
resultC->errorOccurred == PR_FALSE) \
{ \
PROCESS_PENDING_EVENTS_REF (reference); \
@@ -655,7 +655,7 @@ char const* TYPES[10] = { "Object",
PLUGIN_DEBUG_0ARG("RECEIVE STRING UCS 1\n"); \
ResultContainer *resultC; \
factory->result_map.Get(reference, &resultC); \
- while (resultC->returnValueUCS.IsEmpty() && \
+ while (resultC->returnValueUCS.IsVoid() == PR_TRUE && \
resultC->errorOccurred == PR_FALSE) \
{ \
PROCESS_PENDING_EVENTS_REF (reference); \
@@ -855,6 +855,8 @@ ResultContainer::ResultContainer ()
returnIdentifier = -1;
returnValue.Truncate();
returnValueUCS.Truncate();
+ returnValue.SetIsVoid(PR_TRUE);
+ returnValueUCS.SetIsVoid(PR_TRUE);
errorMessage.Truncate();
errorOccurred = PR_FALSE;
@@ -877,6 +879,8 @@ ResultContainer::Clear()
returnIdentifier = -1;
returnValue.Truncate();
returnValueUCS.Truncate();
+ returnValue.SetIsVoid(PR_TRUE);
+ returnValueUCS.SetIsVoid(PR_TRUE);
errorMessage.Truncate();
errorOccurred = PR_FALSE;
@@ -1007,6 +1011,7 @@ private:
nsresult StartAppletviewer ();
void ProcessMessage();
void ConsumeMsgFromJVM();
+ nsresult GetProxyInfo(const char* siteAddr, char** proxyScheme, char** proxyHost, char** proxyPort);
nsCOMPtr<IcedTeaEventSink> sink;
nsCOMPtr<nsISocketTransport> transport;
nsCOMPtr<nsIProcess> applet_viewer_process;
@@ -1792,7 +1797,7 @@ NS_IMETHODIMP
NS_IMETHODIMP
IcedTeaPluginFactory::Show (void)
{
- nsCString msg("showconsole");
+ nsCString msg("plugin showconsole");
this->SendMessageToAppletViewer(msg);
return NS_OK;
}
@@ -1800,7 +1805,7 @@ NS_IMETHODIMP
NS_IMETHODIMP
IcedTeaPluginFactory::Hide (void)
{
- nsCString msg("hideconsole");
+ nsCString msg("plugin hideconsole");
this->SendMessageToAppletViewer(msg);
return NS_OK;
}
@@ -2658,6 +2663,96 @@ IcedTeaPluginInstance::GetJavaObject (jo
return factory->GetJavaObject (instance_identifier, object);
}
+#include <nsIDNSRecord.h>
+#include <nsIDNSService.h>
+#include <nsIHttpAuthManager.h>
+#include <nsIProxyInfo.h>
+#include <nsIProtocolProxyService.h>
+#include <nsILoginManager.h>
+#include <nsILoginInfo.h>
+
+/**
+ *
+ * Returns the proxy information for the given url
+ *
+ * The proxy query part of this function can be made much smaller by using
+ * nsIPluginManager2::FindProxyForURL() .. however, because we need to parse
+ * the return components in various ways, it is easier to query
+ * nsIProtocolProxyService directly
+ *
+ * @param siteAddr The URL to check
+ * @param proxyScheme Return parameter containing the proxy URI scheme (http/socks/etc.)
+ * @param proxyHost Return parameter containing the proxy host
+ * @param proxyPort Return parameter containing the proxy port
+ */
+
+NS_IMETHODIMP
+IcedTeaPluginFactory::GetProxyInfo(const char* siteAddr, char** proxyScheme, char** proxyHost, char** proxyPort)
+{
+ nsresult rv;
+
+ // Initialize service variables
+ nsCOMPtr<nsIProtocolProxyService> proxy_svc = do_GetService(NS_PROTOCOLPROXYSERVICE_CONTRACTID, &rv);
+
+ if (!proxy_svc) {
+ printf("Cannot initialize proxy service\n");
+ return rv;
+ }
+
+ nsCOMPtr<nsIIOService> io_svc = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
+
+ if (NS_FAILED(rv) || !io_svc) {
+ printf("Cannot initialize io service\n");
+ return NS_ERROR_FAILURE;
+ }
+
+ // uri which needs to be accessed
+ nsCOMPtr<nsIURI> uri;
+ io_svc->NewURI(nsCString(siteAddr), NULL, NULL, getter_AddRefs(uri));
+
+ // find the proxy address if any
+ nsCOMPtr<nsIProxyInfo> info;
+ proxy_svc->Resolve(uri, 0, getter_AddRefs(info));
+
+ // if there is no proxy found, return immediately
+ if (!info) {
+ PLUGIN_DEBUG_1ARG("%s does not need a proxy\n", siteAddr);
+ return NS_ERROR_FAILURE;
+ }
+
+ // if proxy info is available, extract it
+ nsCString phost;
+ PRInt32 pport;
+ nsCString ptype;
+
+ info->GetHost(phost);
+ info->GetPort(&pport);
+ info->GetType(ptype);
+
+ // resolve the proxy address to an IP
+ nsCOMPtr<nsIDNSService> dns_svc = do_GetService(NS_DNSSERVICE_CONTRACTID, &rv);
+
+ if (!dns_svc) {
+ printf("Cannot initialize DNS service\n");
+ return rv;
+ }
+
+ nsCOMPtr<nsIDNSRecord> record;
+ dns_svc->Resolve(phost, 0U, getter_AddRefs(record));
+
+ // TODO: Add support for multiple ips
+ nsDependentCString ipAddr;
+ record->GetNextAddrAsString(ipAddr);
+
+ // pack information in return variables
+ snprintf(*proxyScheme, sizeof(char)*32, "%s", ptype.get());
+ snprintf(*proxyHost, sizeof(char)*64, "%s", ipAddr.get());
+ snprintf(*proxyPort, sizeof(char)*8, "%d", pport);
+
+ PLUGIN_DEBUG_4ARG("Proxy info for %s: %s %s %s\n", siteAddr, *proxyScheme, *proxyHost, *proxyPort);
+
+ return NS_OK;
+}
NS_IMETHODIMP
IcedTeaPluginInstance::GetCookie(const char* siteAddr, char** cookieString)
@@ -2677,8 +2772,8 @@ IcedTeaPluginInstance::GetCookie(const c
return NS_ERROR_FAILURE;
}
- nsIURI *uri;
- io_svc->NewURI(nsCString(siteAddr), NULL, NULL, &uri);
+ nsCOMPtr<nsIURI> uri;
+ io_svc->NewURI(nsCString(siteAddr), NULL, NULL, getter_AddRefs(uri));
nsCOMPtr<nsICookieService> cookie_svc = do_GetService(NS_COOKIESERVICE_CONTRACTID, &rv);
@@ -2902,6 +2997,13 @@ IcedTeaPluginFactory::HandleMessage (nsC
nsDependentCSubstring prefix(pch, strlen(pch));
pch = strtok (NULL, " ");
PRUint32 identifier = nsDependentCSubstring(pch, strlen(pch)).ToInteger (&conversionResult);
+
+ /* Certain prefixes may not have an identifier. if they don't. we have a command here */
+ nsDependentCSubstring command;
+ if (NS_FAILED(conversionResult)) {
+ command.Rebind(pch, strlen(pch));
+ }
+
PRUint32 reference = -1;
if (strstr(message.get(), "reference") != NULL) {
@@ -2910,8 +3012,11 @@ IcedTeaPluginFactory::HandleMessage (nsC
reference = nsDependentCSubstring(pch, strlen(pch)).ToInteger (&conversionResult);
}
- pch = strtok (NULL, " ");
- nsDependentCSubstring command(pch, strlen(pch));
+ if (command.Length() == 0) {
+ pch = strtok (NULL, " ");
+ command.Rebind(pch, strlen(pch));
+ }
+
pch = strtok (NULL, " ");
nsDependentCSubstring rest("", 0);
@@ -3251,7 +3356,8 @@ IcedTeaPluginFactory::HandleMessage (nsC
ResultContainer *resultC;
result_map.Get(reference, &resultC);
- resultC->returnValue = rest;
+ resultC->returnValue = rest;
+ resultC->returnValue.SetIsVoid(PR_FALSE);
PLUGIN_DEBUG_1ARG ("PLUGIN GOT RETURN VALUE: %s\n", resultC->returnValue.get());
}
else if (command == "GetStringUTFChars")
@@ -3339,11 +3445,55 @@ IcedTeaPluginFactory::HandleMessage (nsC
ResultContainer *resultC;
result_map.Get(reference, &resultC);
resultC->returnValueUCS = returnValueUCS;
+ resultC->returnValueUCS.SetIsVoid(PR_FALSE);
}
// Do nothing for: SetStaticField, SetField, ExceptionClear,
// DeleteGlobalRef, DeleteLocalRef
}
+ else if (prefix == "plugin")
+ {
+
+ if (command == "PluginProxyInfo") {
+
+ nsresult rv;
+ nsCOMPtr<nsINetUtil> net_util = do_GetService(NS_NETUTIL_CONTRACTID, &rv);
+
+ if (!net_util)
+ printf("Error instantiating NetUtil service.\n");
+
+ // decode the url
+ nsDependentCSubstring url;
+ net_util->UnescapeString(rest, 0, url);
+
+ char* proxyScheme = (char*) malloc(sizeof(char)*32);
+ char* proxyHost = (char*) malloc(sizeof(char)*64);
+ char* proxyPort = (char*) malloc(sizeof(char)*8);
+
+ nsCString proxyInfo("plugin PluginProxyInfo ");
+
+ // get proxy info
+ if (GetProxyInfo(((nsCString) url).get(), &proxyScheme, &proxyHost, &proxyPort) == NS_OK)
+ {
+ proxyInfo += proxyScheme;
+ proxyInfo += " ";
+ proxyInfo += proxyHost;
+ proxyInfo += " ";
+ proxyInfo += proxyPort;
+
+ PLUGIN_DEBUG_4ARG("Proxy for %s is %s %s %s\n", ((nsCString) url).get(), proxyScheme, proxyHost, proxyPort);
+ } else {
+ PLUGIN_DEBUG_1ARG("No suitable proxy found for %s\n", ((nsCString) url).get());
+ }
+
+ // send back what we found
+ SendMessageToAppletViewer (proxyInfo);
+
+ // free allocated memory
+ delete proxyScheme, proxyHost, proxyPort;
+
+ }
+ }
}
void IcedTeaPluginFactory::ProcessMessage ()
diff -r bbac5c54022b -r 8dc304404e01 overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/JNLPFile.java
--- a/overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/JNLPFile.java Wed May 20 20:50:48 2009 +0100
+++ b/overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/JNLPFile.java Wed May 20 21:17:02 2009 +0100
@@ -106,7 +106,7 @@ public class JNLPFile {
// null values will still work, and app can set defaults later
}
}
-
+
/**
* Empty stub, allowing child classes to override the constructor
*/
diff -r bbac5c54022b -r 8dc304404e01 overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/Launcher.java
--- a/overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/Launcher.java Wed May 20 20:50:48 2009 +0100
+++ b/overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/Launcher.java Wed May 20 21:17:02 2009 +0100
@@ -331,6 +331,22 @@ public class Launcher {
throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplication"), R("LNotApplicationInfo")));
try {
+ final int preferredWidth = 500;
+ final int preferredHeight = 400;
+ JNLPSplashScreen splashScreen = null;
+ URL splashImageURL = file.getInformation().getIconLocation(
+ IconDesc.SPLASH, preferredWidth, preferredHeight);
+ if (splashImageURL != null) {
+ ResourceTracker resourceTracker = new ResourceTracker(true);
+ resourceTracker.addResource(splashImageURL, "SPLASH", file.getFileVersion(), updatePolicy);
+ splashScreen = new JNLPSplashScreen(resourceTracker, null, null);
+ splashScreen.setSplashImageURL(splashImageURL);
+ if (splashScreen.isSplashScreenValid()) {
+ splashScreen.setVisible(true);
+ }
+ }
+
+
ApplicationInstance app = createApplication(file);
app.initialize();
@@ -360,6 +376,13 @@ public class Launcher {
// required to make some apps work right
Thread.currentThread().setContextClassLoader(app.getClassLoader());
+
+ if (splashScreen != null) {
+ if (splashScreen.isSplashScreenValid()) {
+ splashScreen.setVisible(false);
+ }
+ splashScreen.dispose();
+ }
main.invoke(null, new Object[] { args } );
diff -r bbac5c54022b -r 8dc304404e01 overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/NetxPanel.java
--- a/overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/NetxPanel.java Wed May 20 20:50:48 2009 +0100
+++ b/overlays/openjdk/jdk/src/share/classes/net/sourceforge/jnlp/NetxPanel.java Wed May 20 21:17:02 2009 +0100
@@ -42,6 +42,7 @@ public class NetxPanel extends AppletVie
private boolean exitOnFailure = true;
private AppletInstance appInst = null;
private String cookieStr;
+ private boolean appletAlive;
public NetxPanel(URL documentURL, Hashtable atts)
{
@@ -54,6 +55,7 @@ public class NetxPanel extends AppletVie
this(documentURL, atts);
this.exitOnFailure = exitOnFailure;
this.cookieStr = cookieStr;
+ this.appletAlive = true;
}
//Overriding to use Netx classloader. You might need to relax visibility
@@ -76,7 +78,7 @@ public class NetxPanel extends AppletVie
if (JNLPRuntime.isDebug())
System.out.println("initializing JNLPRuntime...");
- JNLPRuntime.initialize();
+ JNLPRuntime.initialize(false);
} else {
if (JNLPRuntime.isDebug())
System.out.println("JNLPRuntime already initialized");
@@ -121,10 +123,11 @@ public class NetxPanel extends AppletVie
validate();
}
} catch (Exception e) {
+ this.appletAlive = false;
e.printStackTrace();
}
}
-
+
// Reminder: Relax visibility in sun.applet.AppletPanel
protected synchronized void createAppletThread() {
handler = new Thread(this);
@@ -139,5 +142,9 @@ public class NetxPanel extends AppletVie
public ClassLoader getAppletClassLoader() {
return appInst.getClassLoader();
}
+
+ public boolean isAlive() {
+ return handler.isAlive() && this.appletAlive;
More information about the distro-pkg-dev
mailing list