[webkit-changes] cvs commit: WebKit/Plugins.subproj npfunctions.h
npruntime.h
Adele
adele at opensource.apple.com
Tue Jul 12 21:38:48 PDT 2005
adele 05/07/12 21:38:47
Modified: . Tag: Safari-1-3-branch ChangeLog
bindings Tag: Safari-1-3-branch NP_jsobject.cpp
npruntime.cpp npruntime.h npruntime_impl.h
. Tag: Safari-1-3-branch ChangeLog
Plugins.subproj Tag: Safari-1-3-branch npfunctions.h
npruntime.h
Log:
Merged fix from TOT to Safari-1-3-branch
<rdar://problem/4164997>
2005-04-26 Richard Williamson <rjw at apple.com>
Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
Reviewed by Chris.
* Plugins.subproj/npfunctions.h:
* Plugins.subproj/npruntime.h:
Merged fix from TOT to Safari-1-3-branch
<rdar://problem/4164997>
2005-04-26 Richard Williamson <rjw at apple.com>
Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
We were incompatible with Mozilla's implementation of the scripting APIs in
two ways:
Their NPN_SetException has the following signature:
void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
ours has:
void NPN_SetException (NPObject * npobj, const NPString *message);
Also, they expect the string returned from NPN_UTF8FromIdentifier() to be freed by caller.
We do not.
I changed both behaviors to match Mozilla.
Reviewed by Chris.
* bindings/NP_jsobject.cpp:
(_NPN_SetException):
* bindings/npruntime.cpp:
(_NPN_UTF8FromIdentifier):
(_NPN_IntFromIdentifier):
(_NPN_SetExceptionWithUTF8):
* bindings/npruntime.h:
* bindings/npruntime_impl.h:
Revision Changes Path
No revision
No revision
1.677.4.2 +36 -0 JavaScriptCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
retrieving revision 1.677.4.1
retrieving revision 1.677.4.2
diff -u -r1.677.4.1 -r1.677.4.2
--- ChangeLog 12 Jul 2005 16:23:32 -0000 1.677.4.1
+++ ChangeLog 13 Jul 2005 04:38:42 -0000 1.677.4.2
@@ -1,5 +1,41 @@
2005-07-12 Adele Peterson <adele at apple.com>
+ Merged fix from TOT to Safari-1-3-branch
+ <rdar://problem/4164997>
+
+ 2005-04-26 Richard Williamson <rjw at apple.com>
+
+ Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
+
+ We were incompatible with Mozilla's implementation of the scripting APIs in
+ two ways:
+
+ Their NPN_SetException has the following signature:
+
+ void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
+
+ ours has:
+
+ void NPN_SetException (NPObject * npobj, const NPString *message);
+
+ Also, they expect the string returned from NPN_UTF8FromIdentifier() to be freed by caller.
+ We do not.
+
+ I changed both behaviors to match Mozilla.
+
+ Reviewed by Chris.
+
+ * bindings/NP_jsobject.cpp:
+ (_NPN_SetException):
+ * bindings/npruntime.cpp:
+ (_NPN_UTF8FromIdentifier):
+ (_NPN_IntFromIdentifier):
+ (_NPN_SetExceptionWithUTF8):
+ * bindings/npruntime.h:
+ * bindings/npruntime_impl.h:
+
+2005-07-12 Adele Peterson <adele at apple.com>
+
Merging fix from TOT to Safari-1-3-branch
<rdar://problem/4164929> String.replace() method not working when regex pattern contains {n, m}
No revision
No revision
1.18.6.1 +2 -6 JavaScriptCore/bindings/NP_jsobject.cpp
Index: NP_jsobject.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/NP_jsobject.cpp,v
retrieving revision 1.18
retrieving revision 1.18.6.1
diff -u -r1.18 -r1.18.6.1
--- NP_jsobject.cpp 17 Jan 2005 22:41:22 -0000 1.18
+++ NP_jsobject.cpp 13 Jul 2005 04:38:42 -0000 1.18.6.1
@@ -411,17 +411,13 @@
return false;
}
-void _NPN_SetException (NPObject *o, NPString *message)
+void _NPN_SetException (NPObject *o, const NPUTF8 *message)
{
if (o->_class == NPScriptObjectClass) {
JavaScriptObject *obj = (JavaScriptObject *)o;
ExecState *exec = obj->executionContext->interpreter()->globalExec();
Interpreter::lock();
- char *msg = (char *)malloc (message->UTF8Length + 1);
- strncpy (msg, message->UTF8Characters, message->UTF8Length);
- msg[message->UTF8Length] = 0;
- Object err = Error::create(exec, GeneralError, msg);
- free (msg);
+ Object err = Error::create(exec, GeneralError, message);
exec->setException (err);
Interpreter::unlock();
}
1.17.8.1 +7 -8 JavaScriptCore/bindings/npruntime.cpp
Index: npruntime.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/npruntime.cpp,v
retrieving revision 1.17
retrieving revision 1.17.8.1
diff -u -r1.17 -r1.17.8.1
--- npruntime.cpp 5 Oct 2004 23:19:20 -0000 1.17
+++ npruntime.cpp 13 Jul 2005 04:38:42 -0000 1.17.8.1
@@ -163,16 +163,18 @@
NPUTF8 *_NPN_UTF8FromIdentifier (NPIdentifier identifier)
{
PrivateIdentifier *i = (PrivateIdentifier *)identifier;
- if (!i->isString)
+ if (!i->isString || !i->value.string)
return NULL;
- return (NPUTF8 *)i->value.string;
+ return (NPUTF8 *)strdup(i->value.string);
}
int32_t _NPN_IntFromIdentifier(NPIdentifier identifier)
{
- // FIXME: Implement!
- return 0;
+ PrivateIdentifier *i = (PrivateIdentifier *)identifier;
+ if (!i->isString)
+ return 0;
+ return i->value.number;
}
NPBool NPN_VariantIsVoid (const NPVariant *variant)
@@ -434,9 +436,6 @@
assert (message);
if (obj && message) {
- NPString string;
- string.UTF8Characters = message;
- string.UTF8Length = length;
- _NPN_SetException (obj, &string);
+ _NPN_SetException (obj, message);
}
}
1.23.8.1 +1 -1 JavaScriptCore/bindings/npruntime.h
Index: npruntime.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/npruntime.h,v
retrieving revision 1.23
retrieving revision 1.23.8.1
diff -u -r1.23 -r1.23.8.1
--- npruntime.h 1 Oct 2004 00:24:38 -0000 1.23
+++ npruntime.h 13 Jul 2005 04:38:42 -0000 1.23.8.1
@@ -329,7 +329,7 @@
NPN_SetException may be called to trigger a script exception upon return
from entry points into NPObjects.
*/
-void NPN_SetException (NPObject *obj, NPString *message);
+void NPN_SetException (NPObject *obj, const NPUTF8 *message);
#ifdef __cplusplus
}
1.1.8.1 +1 -1 JavaScriptCore/bindings/npruntime_impl.h
Index: npruntime_impl.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/npruntime_impl.h,v
retrieving revision 1.1
retrieving revision 1.1.8.1
diff -u -r1.1 -r1.1.8.1
--- npruntime_impl.h 30 Sep 2004 01:32:04 -0000 1.1
+++ npruntime_impl.h 13 Jul 2005 04:38:43 -0000 1.1.8.1
@@ -50,7 +50,7 @@
extern bool _NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName);
extern bool _NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName);
extern bool _NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName);
-extern void _NPN_SetException(NPObject *obj, NPString *message);
+extern void _NPN_SetException(NPObject *obj, const NPUTF8 *message);
#ifdef __cplusplus
} /* end extern "C" */
No revision
No revision
1.3120.2.9 +14 -0 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3120.2.8
retrieving revision 1.3120.2.9
diff -u -r1.3120.2.8 -r1.3120.2.9
--- ChangeLog 13 Jul 2005 00:56:59 -0000 1.3120.2.8
+++ ChangeLog 13 Jul 2005 04:38:43 -0000 1.3120.2.9
@@ -1,5 +1,19 @@
2005-07-12 Adele Peterson <adele at apple.com>
+ Merged fix from TOT to Safari-1-3-branch
+ <rdar://problem/4164997>
+
+ 2005-04-26 Richard Williamson <rjw at apple.com>
+
+ Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
+
+ Reviewed by Chris.
+
+ * Plugins.subproj/npfunctions.h:
+ * Plugins.subproj/npruntime.h:
+
+2005-07-12 Adele Peterson <adele at apple.com>
+
Merged WebKit part of fix from TOT to Safari-1-3-branch
<rdar://problem/4176173>
No revision
No revision
1.6.8.1 +1 -1 WebKit/Plugins.subproj/npfunctions.h
Index: npfunctions.h
===================================================================
RCS file: /cvs/root/WebKit/Plugins.subproj/npfunctions.h,v
retrieving revision 1.6
retrieving revision 1.6.8.1
diff -u -r1.6 -r1.6.8.1
--- npfunctions.h 15 Sep 2004 02:48:37 -0000 1.6
+++ npfunctions.h 13 Jul 2005 04:38:47 -0000 1.6.8.1
@@ -50,7 +50,7 @@
typedef bool (*NPN_HasPropertyProcPtr) (NPP, NPObject *npobj, NPIdentifier propertyName);
typedef bool (*NPN_HasMethodProcPtr) (NPP npp, NPObject *npobj, NPIdentifier methodName);
typedef bool (*NPN_RemovePropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName);
-typedef void (*NPN_SetExceptionProcPtr) (NPObject *obj, NPString *message);
+typedef void (*NPN_SetExceptionProcPtr) (NPObject *obj, const NPUTF8 *message);
typedef NPError (*NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
typedef NPError (*NPP_DestroyProcPtr)(NPP instance, NPSavedData** save);
1.17.8.1 +1 -1 WebKit/Plugins.subproj/Attic/npruntime.h
Index: npruntime.h
===================================================================
RCS file: /cvs/root/WebKit/Plugins.subproj/Attic/npruntime.h,v
retrieving revision 1.17
retrieving revision 1.17.8.1
diff -u -r1.17 -r1.17.8.1
--- npruntime.h 1 Oct 2004 00:24:38 -0000 1.17
+++ npruntime.h 13 Jul 2005 04:38:47 -0000 1.17.8.1
@@ -329,7 +329,7 @@
NPN_SetException may be called to trigger a script exception upon return
from entry points into NPObjects.
*/
-void NPN_SetException (NPObject *obj, NPString *message);
+void NPN_SetException (NPObject *obj, const NPUTF8 *message);
#ifdef __cplusplus
}
More information about the webkit-changes
mailing list