/hg/icedtea: 2 new changesets
andrew at icedtea.classpath.org
andrew at icedtea.classpath.org
Tue May 11 13:45:50 PDT 2010
changeset 5aad5596cd2f in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=5aad5596cd2f
author: Andrew John Hughes <ahughes at redhat.com>
date: Tue May 11 21:06:13 2010 +0100
Decide on libjpeg library at compile-time not runtime.
2010-01-11 Andrew John Hughes <ahughes at redhat.com>
* patches/icedtea-libraries.patch: Decide which
libjpeg library to load at compile-time not runtime using
JPEG_LIB_VERSION. (See http://bugs.debian.org/563999)
changeset b361e1d82aaa in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=b361e1d82aaa
author: Deepak Bhole <dbhole at redhat.com>
date: Tue May 11 21:40:50 2010 +0100
- Adding last bits for full Java->JS array element access (read and
write) support.
- Checking in initial version of LiveConnect tests (WIP)
2010-05-11 Andrew John Hughes <ahughes at redhat.com>
* .hgignore: Remove jar files.
2010-01-13 Deepak Bhole <dbhole at redhat.com>
* plugin/icedteanp/IcedTeaJavaRequestProcessor.cc:
Add missing newline.
* plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
(newMessageOnBus): Service GetSlot and SetSlot requests.
(call): Create Java object from result only if it is non-null.
(setMember): Pass a preset identifier to _setMember. Handle array
slot setting. (sendMember): Handle array slot read.
(queue_processor): Service GetSlot and SetSlot requests.
(_setMember): Work with property NPIdentifier instead of name
string. (_getMember): Same.
* plugin/icedteanp/IcedTeaPluginUtils.cc (isObjectJSArray):
Handle void constructor objects like 'window'.
diffstat:
6 files changed, 74 insertions(+), 32 deletions(-)
.hgignore | 1
ChangeLog | 28 +++++++++++
patches/icedtea-libraries.patch | 18 ++++---
plugin/icedteanp/IcedTeaJavaRequestProcessor.cc | 2
plugin/icedteanp/IcedTeaPluginRequestProcessor.cc | 51 ++++++++++++---------
plugin/icedteanp/IcedTeaPluginUtils.cc | 6 ++
diffs (248 lines):
diff -r 0e1f42ea40cf -r b361e1d82aaa .hgignore
--- a/.hgignore Tue May 11 14:05:30 2010 +0100
+++ b/.hgignore Tue May 11 21:40:50 2010 +0100
@@ -10,4 +10,3 @@ install-sh
install-sh
Makefile.in
*.sh
-plugin/tests/LiveConnect/*jar
diff -r 0e1f42ea40cf -r b361e1d82aaa ChangeLog
--- a/ChangeLog Tue May 11 14:05:30 2010 +0100
+++ b/ChangeLog Tue May 11 21:40:50 2010 +0100
@@ -1,3 +1,31 @@ 2010-05-11 Andrew John Hughes <ahughes@
+2010-05-11 Andrew John Hughes <ahughes at redhat.com>
+
+ * .hgignore: Remove jar files.
+
+2010-01-13 Deepak Bhole <dbhole at redhat.com>
+
+ * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc:
+ Add missing newline.
+ * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
+ (newMessageOnBus): Service GetSlot and SetSlot requests.
+ (call): Create Java object from result only if it is non-null.
+ (setMember): Pass a preset identifier to _setMember. Handle array slot
+ setting.
+ (sendMember): Handle array slot read.
+ (queue_processor): Service GetSlot and SetSlot requests.
+ (_setMember): Work with property NPIdentifier instead of name string.
+ (_getMember): Same.
+ * plugin/icedteanp/IcedTeaPluginUtils.cc
+ (isObjectJSArray): Handle void constructor objects like 'window'.
+
+2010-01-11 Andrew John Hughes <ahughes at redhat.com>
+
+ * patches/icedtea-libraries.patch:
+ Decide which libjpeg library to load
+ at compile-time not runtime using
+ JPEG_LIB_VERSION.
+ (See http://bugs.debian.org/563999)
+
2010-05-11 Andrew John Hughes <ahughes at redhat.com>
Fix issues with the CACAO build so it at
diff -r 0e1f42ea40cf -r b361e1d82aaa patches/icedtea-libraries.patch
--- a/patches/icedtea-libraries.patch Tue May 11 14:05:30 2010 +0100
+++ b/patches/icedtea-libraries.patch Tue May 11 21:40:50 2010 +0100
@@ -700,17 +700,18 @@ diff -Nru openjdk.orig/jdk/src/share/nat
}
-@@ -2341,6 +2401,145 @@
+@@ -2341,6 +2401,146 @@
/********************** end of destination manager ************/
+METHODDEF(void)
+initIDs()
+{
++#if JPEG_LIB_VERSION >= 70
+ void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
-+ if (handle == NULL) {
-+ handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
-+ }
++#else
++ void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
++#endif
+
+ jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
+ if (jpegstderror == NULL) {
@@ -20987,14 +20988,15 @@ diff -Nru openjdk.orig/jdk/src/share/nat
/* Initialize the Java VM instance variable when the library is
first loaded */
JavaVM *jvm;
-@@ -462,6 +490,71 @@
+@@ -462,6 +490,72 @@
Java_sun_awt_image_JPEGImageDecoder_initIDs(JNIEnv *env, jclass cls,
jclass InputStreamClass)
{
++#if JPEG_LIB_VERSION >= 70
+ void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
-+ if (handle == NULL) {
-+ handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
-+ }
++#else
++ void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
++#endif
+
+ jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
+ if (jpegstderror == NULL) {
diff -r 0e1f42ea40cf -r b361e1d82aaa plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
--- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc Tue May 11 14:05:30 2010 +0100
+++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc Tue May 11 21:40:50 2010 +0100
@@ -899,7 +899,7 @@ createJavaObjectFromVariant(NPP instance
alreadyCreated = true;
} else
{
- PLUGIN_DEBUG_0ARG("NPObject is not a Java object");
+ PLUGIN_DEBUG_0ARG("NPObject is not a Java object\n");
NPIdentifier length_id = browser_functions.getstringidentifier("length");
// FIXME: We currently only handle <= 2 dim arrays. Do we really need more though?
diff -r 0e1f42ea40cf -r b361e1d82aaa plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
--- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc Tue May 11 14:05:30 2010 +0100
+++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc Tue May 11 21:40:50 2010 +0100
@@ -333,7 +333,14 @@ PluginRequestProcessor::call(std::vector
NPVariant* result_variant = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(thread_data.result);
std::string result_variant_jniid = std::string();
- createJavaObjectFromVariant(instance, *result_variant, &result_variant_jniid);
+
+ if (result_variant)
+ {
+ createJavaObjectFromVariant(instance, *result_variant, &result_variant_jniid);
+ } else
+ {
+ result_variant_jniid = "0";
+ }
IcedTeaPluginUtilities::constructMessagePrefix(0, &response);
response += " JavaScriptCall ";
@@ -414,6 +421,7 @@ PluginRequestProcessor::setMember(std::v
NPP instance;
NPVariant* member;
+ NPIdentifier property_identifier;
JavaRequestProcessor java_request = JavaRequestProcessor();
JavaResultData* java_result;
@@ -435,20 +443,13 @@ PluginRequestProcessor::setMember(std::v
instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(member);
- java_result = java_request.getString(propertyNameID);
-
- // the result we want is in result_string (assuming there was no error)
- if (java_result->error_occurred)
- {
- printf("Unable to get member name for setMember. Error occurred: %s\n", java_result->error_msg);
- //goto cleanup;
- }
-
- property_identifier = browser_functions.getstringidentifier(java_result->return_string->c_str());
+ if (message_parts->at(2) == "SetSlot")
+ {
+ property_identifier = browser_functions.getintidentifier(atoi(message_parts->at(4).c_str()));
+ } else
+ {
+ java_result = java_request.getString(propertyNameID);
}
-
- // Copy into local variable before disposing the object
- property_name.append(*(java_result->return_string));
AsyncCallThreadData thread_data = AsyncCallThreadData();
thread_data.result_ready = false;
@@ -457,7 +458,7 @@ PluginRequestProcessor::setMember(std::v
thread_data.parameters.push_back(instance);
thread_data.parameters.push_back(NPVARIANT_TO_OBJECT(*member));
- thread_data.parameters.push_back(&property_name);
+ thread_data.parameters.push_back(&property_identifier);
thread_data.parameters.push_back(&value);
#ifdef CHROMIUM_WORKAROUND
@@ -511,6 +512,8 @@ PluginRequestProcessor::sendMember(std::
NPIdentifier member_identifier;
+ NPIdentifier member_identifier;
+
int method_id;
int instance_id;
long reference;
@@ -554,7 +557,7 @@ PluginRequestProcessor::sendMember(std::
NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(parent_ptr);
thread_data.parameters.push_back(instance);
thread_data.parameters.push_back(NPVARIANT_TO_OBJECT(*parent_ptr));
- thread_data.parameters.push_back(java_result->return_string);
+ thread_data.parameters.push_back(&member_identifier);
#ifdef CHROMIUM_WORKAROUND
// Workaround for chromium
@@ -696,6 +699,12 @@ queue_processor(void* data)
pthread_mutex_lock(&syn_write_mutex);
processor->sendMember(message_parts);
pthread_mutex_unlock(&syn_write_mutex);
+ } else if (command == "SetSlot")
+ {
+ // write methods are synchronized
+ pthread_mutex_lock(&syn_write_mutex);
+ processor->setMember(message_parts);
+ pthread_mutex_unlock(&syn_write_mutex);
} else
{
// Nothing matched
@@ -733,16 +742,16 @@ _setMember(void* data)
std::vector<void*> parameters = ((AsyncCallThreadData*) data)->parameters;
instance = (NPP) parameters.at(0);
member = (NPObject*) parameters.at(1);
- property_name = (std::string*) parameters.at(2);
+ property = (NPIdentifier*) parameters.at(2);
value = (std::string*) parameters.at(3);
PLUGIN_DEBUG_4ARG("Setting %s on instance %p, object %p to value %s\n",
- property_name->c_str(), instance, member, value->c_str());
+ browser_functions.utf8fromidentifier(*property),
+ instance, member, value->c_str());
IcedTeaPluginUtilities::javaResultToNPVariant(instance, value, &value_variant);
- property = browser_functions.getstringidentifier(property_name->c_str());
- ((AsyncCallThreadData*) data)->call_successful = browser_functions.setproperty(instance, member, property, &value_variant);
+ ((AsyncCallThreadData*) data)->call_successful = browser_functions.setproperty(instance, member, *property, &value_variant);
IcedTeaPluginUtilities::constructMessagePrefix(0, &response);
response.append(" JavaScriptSetMember ");
@@ -776,7 +785,7 @@ _getMember(void* data)
printf("%s not found!\n", browser_functions.utf8fromidentifier(*member_identifier));
}
((AsyncCallThreadData*) data)->call_successful =
- browser_functions.getproperty(instance, parent_ptr, member_identifier, member_ptr);
+ browser_functions.getproperty(instance, parent_ptr, *member_identifier, member_ptr);
IcedTeaPluginUtilities::printNPVariant(*member_ptr);
diff -r 0e1f42ea40cf -r b361e1d82aaa plugin/icedteanp/IcedTeaPluginUtils.cc
--- a/plugin/icedteanp/IcedTeaPluginUtils.cc Tue May 11 14:05:30 2010 +0100
+++ b/plugin/icedteanp/IcedTeaPluginUtils.cc Tue May 11 21:40:50 2010 +0100
@@ -817,14 +817,18 @@ IcedTeaPluginUtilities::isObjectJSArray(
NPVariant constructor_v = NPVariant();
NPIdentifier constructor_id = browser_functions.getstringidentifier("constructor");
browser_functions.getproperty(instance, object, constructor_id, &constructor_v);
+ IcedTeaPluginUtilities::printNPVariant(constructor_v);
- IcedTeaPluginUtilities::printNPVariant(constructor_v);
+ // void constructor => not an array
+ if (NPVARIANT_IS_VOID(constructor_v))
+ return false;
NPObject* constructor = NPVARIANT_TO_OBJECT(constructor_v);
NPVariant constructor_str;
NPIdentifier toString = browser_functions.getstringidentifier("toString");
browser_functions.invoke(instance, constructor, toString, NULL, 0, &constructor_str);
+ IcedTeaPluginUtilities::printNPVariant(constructor_str);
std::string constructor_name = std::string();
More information about the distro-pkg-dev
mailing list