[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:30:08 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 4e33c930cd1f319a57482080ca35682171d9dae3
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Mar 17 21:33:25 2004 +0000
Added a context parameter (supplied by client) to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
Reviewed by Ken.
* bindings/NP_jsobject.cpp:
(NP_Call):
(NP_Evaluate):
(NP_GetProperty):
(NP_ToString):
(NP_GetPropertyAtIndex):
* bindings/NP_runtime.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6236 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index a133831..b92d63b 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,17 @@
+2004-03-17 Richard Williamson <rjw at apple.com>
+
+ Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
+
+ Reviewed by Ken.
+
+ * bindings/NP_jsobject.cpp:
+ (NP_Call):
+ (NP_Evaluate):
+ (NP_GetProperty):
+ (NP_ToString):
+ (NP_GetPropertyAtIndex):
+ * bindings/NP_runtime.h:
+
2004-03-16 Richard Williamson <rjw at apple.com>
Fixed 3590169. Regression (crash) caused by the switch to MethodLists. Crash when attempting to invoke a method from JavaScript to Java that is not implemented.
diff --git a/JavaScriptCore/bindings/NP_jsobject.cpp b/JavaScriptCore/bindings/NP_jsobject.cpp
index cadf71e..ca684a1 100644
--- a/JavaScriptCore/bindings/NP_jsobject.cpp
+++ b/JavaScriptCore/bindings/NP_jsobject.cpp
@@ -82,7 +82,7 @@ Identifier identiferFromNPIdentifier(NP_Identifier ident)
return identifier;
}
-void NP_Call (NP_JavaScriptObject *o, NP_Identifier ident, NP_Object **args, unsigned argCount, NP_JavaScriptResultInterface resultCallback)
+void NP_Call (NP_JavaScriptObject *o, NP_Identifier ident, NP_Object **args, unsigned argCount, NP_JavaScriptResultInterface resultCallback, void *resultContext)
{
JavaScriptObject *obj = (JavaScriptObject *)o;
@@ -93,11 +93,11 @@ void NP_Call (NP_JavaScriptObject *o, NP_Identifier ident, NP_Object **args, uns
Value func = obj->imp->get (exec, identiferFromNPIdentifier(ident));
Interpreter::unlock();
if (func.isNull()) {
- resultCallback (NP_GetNull());
+ resultCallback (NP_GetNull(), resultContext);
return;
}
else if ( func.type() == UndefinedType) {
- resultCallback (NP_GetUndefined());
+ resultCallback (NP_GetUndefined(), resultContext);
return;
}
@@ -112,10 +112,10 @@ void NP_Call (NP_JavaScriptObject *o, NP_Identifier ident, NP_Object **args, uns
// Convert and return the result of the function call.
NP_Object *npresult = convertValueToNPValueType(exec, result);
- resultCallback (npresult);
+ resultCallback (npresult, resultContext);
}
-void NP_Evaluate (NP_JavaScriptObject *o, NP_String *s, NP_JavaScriptResultInterface resultCallback)
+void NP_Evaluate (NP_JavaScriptObject *o, NP_String *s, NP_JavaScriptResultInterface resultCallback, void *resultContext)
{
JavaScriptObject *obj = (JavaScriptObject *)o;
@@ -130,10 +130,10 @@ void NP_Evaluate (NP_JavaScriptObject *o, NP_String *s, NP_JavaScriptResultInter
NP_Object *npresult = convertValueToNPValueType(exec, result);
- resultCallback (npresult);
+ resultCallback (npresult, resultContext);
}
-void NP_GetProperty (NP_JavaScriptObject *o, NP_Identifier propertyName, NP_JavaScriptResultInterface resultCallback)
+void NP_GetProperty (NP_JavaScriptObject *o, NP_Identifier propertyName, NP_JavaScriptResultInterface resultCallback, void *resultContext)
{
JavaScriptObject *obj = (JavaScriptObject *)o;
@@ -144,7 +144,7 @@ void NP_GetProperty (NP_JavaScriptObject *o, NP_Identifier propertyName, NP_Java
NP_Object *npresult = convertValueToNPValueType(exec, result);
- resultCallback (npresult);
+ resultCallback (npresult, resultContext);
}
void NP_SetProperty (NP_JavaScriptObject *o, NP_Identifier propertyName, NP_Object *value)
@@ -167,7 +167,7 @@ void NP_RemoveProperty (NP_JavaScriptObject *o, NP_Identifier propertyName)
Interpreter::unlock();
}
-void NP_ToString (NP_JavaScriptObject *o, NP_JavaScriptResultInterface resultCallback)
+void NP_ToString (NP_JavaScriptObject *o, NP_JavaScriptResultInterface resultCallback, void *resultContext)
{
JavaScriptObject *obj = (JavaScriptObject *)o;
@@ -179,10 +179,10 @@ void NP_ToString (NP_JavaScriptObject *o, NP_JavaScriptResultInterface resultCal
Interpreter::unlock();
- resultCallback (value);
+ resultCallback (value, resultContext);
}
-void NP_GetPropertyAtIndex (NP_JavaScriptObject *o, int32_t index, NP_JavaScriptResultInterface resultCallback)
+void NP_GetPropertyAtIndex (NP_JavaScriptObject *o, int32_t index, NP_JavaScriptResultInterface resultCallback, void *resultContext)
{
JavaScriptObject *obj = (JavaScriptObject *)o;
@@ -193,7 +193,7 @@ void NP_GetPropertyAtIndex (NP_JavaScriptObject *o, int32_t index, NP_JavaScript
NP_Object *npresult = convertValueToNPValueType(exec, result);
- resultCallback (npresult);
+ resultCallback (npresult, resultContext);
}
void NP_SetPropertyAtIndex (NP_JavaScriptObject *o, unsigned index, NP_Object value)
diff --git a/JavaScriptCore/bindings/npruntime.h b/JavaScriptCore/bindings/npruntime.h
index eb223aa..b98b2c1 100644
--- a/JavaScriptCore/bindings/npruntime.h
+++ b/JavaScriptCore/bindings/npruntime.h
@@ -38,6 +38,8 @@
* pointers instead of objects.
* Added NP_IsValidIdentifier().
*
+ * Revision 5 (March 17, 2004):
+ * Added context parameter to result callbacks from JavaScriptObject functions.
*/
#ifndef _NP_RUNTIME_H_
#define _NP_RUNTIME_H_
@@ -101,7 +103,12 @@ typedef NP_Object NP_JavaScriptObject;
*/
typedef uint32_t NP_Identifier;
+
+/*
+ NP_UTF8 strings are null terminated.
+*/
typedef char NP_UTF8;
+
typedef uint16_t NP_UTF16;
/*
@@ -171,8 +178,10 @@ struct NP_Object {
};
/*
- If the class has a create interface this function invokes that interface,
- otherwise a NP_Object is allocated and returned.
+ If the class has an allocate interface this function invokes that interface,
+ otherwise a NP_Object is allocated and returned. If a class has an allocate
+ interface it is the responsibility of that interface to set the initial retain
+ count to 1.
*/
NP_Object *NP_CreateObject (NP_Class *aClass);
@@ -217,15 +226,15 @@ typedef NP_Object NP_String;
Calls made from JavaScript to the plugin will always be made on the main
user agent thread, this include calls to NP_JavaScriptResultInterface callbacks.
*/
-typedef void (*NP_JavaScriptResultInterface)(NP_Object *obj);
+typedef void (*NP_JavaScriptResultInterface)(NP_Object *obj, void *resultContext);
-void NP_Call (NP_JavaScriptObject *obj, NP_Identifier methodName, NP_Object **args, unsigned argCount, NP_JavaScriptResultInterface result);
-void NP_Evaluate (NP_JavaScriptObject *obj, NP_String *script, NP_JavaScriptResultInterface result);
-void NP_GetProperty (NP_JavaScriptObject *obj, NP_Identifier propertyName, NP_JavaScriptResultInterface result);
+void NP_Call (NP_JavaScriptObject *obj, NP_Identifier methodName, NP_Object **args, unsigned argCount, NP_JavaScriptResultInterface resultCallback);
+void NP_Evaluate (NP_JavaScriptObject *obj, NP_String *script, NP_JavaScriptResultInterface resultCallback, void *resultContext);
+void NP_GetProperty (NP_JavaScriptObject *obj, NP_Identifier propertyName, NP_JavaScriptResultInterface resultCallback, void *resultContext);
void NP_SetProperty (NP_JavaScriptObject *obj, NP_Identifier propertyName, NP_Object *value);
void NP_RemoveProperty (NP_JavaScriptObject *obj, NP_Identifier propertyName);
-void NP_ToString (NP_JavaScriptObject *obj, NP_JavaScriptResultInterface result);
-void NP_GetPropertyAtIndex (NP_JavaScriptObject *obj, int32_t index, NP_JavaScriptResultInterface result);
+void NP_ToString (NP_JavaScriptObject *obj, NP_JavaScriptResultInterface result, void *resultContext);
+void NP_GetPropertyAtIndex (NP_JavaScriptObject *obj, int32_t index, NP_JavaScriptResultInterface resultCallback, void *resultContext);
void NP_SetPropertyAtIndex (NP_JavaScriptObject *obj, unsigned index, NP_Object *value);
/*
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list