Changeset 20613 in webkit
- Timestamp:
- Mar 30, 2007 10:29:50 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r20569 r20613 1 2007-03-30 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Geoff. 4 5 Implement _NPN_Enumerate support. 6 7 * JavaScriptCore.exp: 8 * bindings/NP_jsobject.cpp: 9 (_NPN_Enumerate): 10 * bindings/c/c_instance.cpp: 11 (KJS::Bindings::CInstance::getPropertyNames): 12 * bindings/c/c_instance.h: 13 * bindings/npapi.h: 14 * bindings/npruntime.h: 15 * bindings/npruntime_impl.h: 16 * bindings/runtime.h: 17 (KJS::Bindings::Instance::getPropertyNames): 18 * bindings/runtime_object.cpp: 19 (RuntimeObjectImp::getPropertyNames): 20 * bindings/runtime_object.h: 21 (KJS::RuntimeObjectImp::getInternalInstance): 22 1 23 2007-03-28 Jeff Walden <jwalden+code@mit.edu> 2 24 -
trunk/JavaScriptCore/JavaScriptCore.exp
r20368 r20613 85 85 __NPN_CreateObject 86 86 __NPN_DeallocateObject 87 __NPN_Enumerate 87 88 __NPN_Evaluate 88 89 __NPN_GetIntIdentifier -
trunk/JavaScriptCore/bindings/NP_jsobject.cpp
r20544 r20613 31 31 #include "npruntime_priv.h" 32 32 #include "object.h" 33 #include "PropertyNameArray.h" 33 34 #include "runtime_root.h" 34 35 … … 65 66 } 66 67 67 static NPClass javascriptClass = { 1, jsAllocate, jsDeallocate, 0, 0, 0, 0, 0, 0, 0, 0 };68 static NPClass noScriptClass = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };68 static NPClass javascriptClass = { 1, jsAllocate, jsDeallocate, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 69 static NPClass noScriptClass = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 69 70 70 71 NPClass* NPScriptObjectClass = &javascriptClass; … … 393 394 } 394 395 } 396 397 bool _NPN_Enumerate(NPP npp, NPObject *o, NPIdentifier **identifier, uint32_t *count) 398 { 399 if (o->_class == NPScriptObjectClass) { 400 JavaScriptObject* obj = (JavaScriptObject*)o; 401 if (!_isSafeScript(obj)) 402 return false; 403 404 RootObject* rootObject = obj->rootObject; 405 if (!rootObject || !rootObject->isValid()) 406 return false; 407 408 ExecState* exec = rootObject->interpreter()->globalExec(); 409 JSLock lock; 410 PropertyNameArray propertyNames; 411 412 obj->imp->getPropertyNames(exec, propertyNames); 413 unsigned size = propertyNames.size(); 414 // FIXME: This should really call NPN_MemAlloc but that's in WebKit 415 NPIdentifier *identifiers = static_cast<NPIdentifier*>(malloc(sizeof(NPIdentifier) * size)); 416 417 for (unsigned i = 0; i < size; i++) 418 identifiers[i] = _NPN_GetStringIdentifier(propertyNames[i].ustring().UTF8String().c_str()); 419 420 *identifier = identifiers; 421 *count = size; 422 423 return true; 424 } 425 426 if (NP_CLASS_STRUCT_VERSION_HAS_ENUM(o->_class) && o->_class->enumerate) 427 return o->_class->enumerate(o, identifier, count); 428 429 return false; 430 } -
trunk/JavaScriptCore/bindings/c/c_instance.cpp
r20104 r20613 32 32 #include "list.h" 33 33 #include "npruntime_impl.h" 34 #include "PropertyNameArray.h" 34 35 #include "runtime_root.h" 35 36 #include <wtf/StringExtras.h> … … 174 175 } 175 176 176 } 177 } 177 void CInstance::getPropertyNames(ExecState*, PropertyNameArray& nameArray) 178 { 179 if (!NP_CLASS_STRUCT_VERSION_HAS_ENUM(_object->_class) || 180 !_object->_class->enumerate) 181 return; 182 183 unsigned count; 184 NPIdentifier* identifiers; 185 186 { 187 JSLock::DropAllLocks dropAllLocks; 188 if (!_object->_class->enumerate(_object, &identifiers, &count)) 189 return; 190 } 191 192 for (unsigned i = 0; i < count; i++) { 193 PrivateIdentifier* identifier = static_cast<PrivateIdentifier*>(identifiers[i]); 194 195 if (identifier->isString) 196 nameArray.add(identifierFromNPIdentifier(identifier->value.string)); 197 else 198 nameArray.add(Identifier::from(identifier->value.number)); 199 } 200 201 // FIXME: This should really call NPN_MemFree but that's in WebKit 202 free(identifiers); 203 } 204 205 } 206 } -
trunk/JavaScriptCore/bindings/c/c_instance.h
r20104 r20613 55 55 virtual JSValue *invokeMethod (ExecState *exec, const MethodList &method, const List &args); 56 56 virtual JSValue *invokeDefaultMethod (ExecState *exec, const List &args); 57 virtual void getPropertyNames(ExecState*, PropertyNameArray&); 57 58 58 59 JSValue *stringValue() const; -
trunk/JavaScriptCore/bindings/npapi.h
r15990 r20613 105 105 106 106 #define NP_VERSION_MAJOR 0 107 #define NP_VERSION_MINOR 1 4107 #define NP_VERSION_MINOR 17 108 108 109 109 … … 678 678 void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion); 679 679 void NPN_ForceRedraw(NPP instance); 680 void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled); 681 void NPN_PopPopupsEnabledState(NPP instance); 680 682 681 683 #ifdef __cplusplus -
trunk/JavaScriptCore/bindings/npruntime.h
r15146 r20613 247 247 typedef bool (*NPSetPropertyFunctionPtr)(NPObject *obj, NPIdentifier name, const NPVariant *value); 248 248 typedef bool (*NPRemovePropertyFunctionPtr)(NPObject *npobj, NPIdentifier name); 249 typedef bool (*NPEnumerationFunctionPtr)(NPObject *npobj, NPIdentifier **value, uint32_t *count); 249 250 250 251 /* … … 263 264 (The runtime will typically return immediately, with 0 or NULL, from an attempt to 264 265 dispatch to a NPObject, but this behavior should not be depended upon.) 266 267 The NPEnumerationFunctionPtr function may pass an array of 268 NPIdentifiers back to the caller. The callee allocs the memory of 269 the array using NPN_MemAlloc(), and it's the caller's responsibility 270 to release it using NPN_MemFree(). 265 271 */ 266 272 struct NPClass … … 277 283 NPSetPropertyFunctionPtr setProperty; 278 284 NPRemovePropertyFunctionPtr removeProperty; 285 NPEnumerationFunctionPtr enumerate; 279 286 }; 280 287 281 #define NP_CLASS_STRUCT_VERSION 1 288 #define NP_CLASS_STRUCT_VERSION 2 289 #define NP_CLASS_STRUCT_VERSION_ENUM 2 290 #define NP_CLASS_STRUCT_VERSION_HAS_ENUM(npclass) \ 291 ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_ENUM) 282 292 283 293 struct NPObject { … … 326 336 bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName); 327 337 bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName); 338 bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count); 328 339 329 340 /* -
trunk/JavaScriptCore/bindings/npruntime_impl.h
r14951 r20613 53 53 extern bool _NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName); 54 54 extern void _NPN_SetException(NPObject *obj, const NPUTF8 *message); 55 extern bool _NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count); 55 56 56 57 #ifdef __cplusplus -
trunk/JavaScriptCore/bindings/runtime.h
r20292 r20613 36 36 class Identifier; 37 37 class List; 38 class PropertyNameArray; 38 39 39 40 namespace Bindings { … … 171 172 virtual JSValue* invokeDefaultMethod(ExecState*, const List&) { return jsUndefined(); } 172 173 174 virtual void getPropertyNames(ExecState*, PropertyNameArray&) { } 175 173 176 virtual JSValue* defaultValue(JSType hint) const = 0; 174 177 -
trunk/JavaScriptCore/bindings/runtime_object.cpp
r20104 r20613 195 195 } 196 196 197 void RuntimeObjectImp::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames) 198 { 199 instance->begin(); 200 instance->getPropertyNames(exec, propertyNames); 201 instance->end(); 202 } 203 -
trunk/JavaScriptCore/bindings/runtime_object.h
r12840 r20613 45 45 virtual bool implementsCall() const; 46 46 virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args); 47 virtual void getPropertyNames(ExecState*, PropertyNameArray&); 48 49 Bindings::Instance *getInternalInstance() const { return instance.get(); } 47 50 48 Bindings::Instance *getInternalInstance() const { return instance.get(); }49 50 51 static const ClassInfo info; 51 52 -
trunk/LayoutTests/ChangeLog
r20608 r20613 1 2007-03-30 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Geoff. 4 5 Add enumeration test. 6 7 * plugins/netscape-enumerate-expected.txt: Added. 8 * plugins/netscape-enumerate.html: Added. 9 1 10 2007-03-29 Geoffrey Garen <ggaren@apple.com> 2 11 -
trunk/WebKit/ChangeLog
r20597 r20613 1 2007-03-30 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Geoff. 4 5 * Plugins/WebNetscapePluginPackage.m: 6 (-[WebNetscapePluginPackage load]): 7 Initialize pushpopupsenabledstate, poppopupsenabledstate and enumerate. 8 9 * Plugins/npapi.m: 10 (NPN_PushPopupsEnabledState): 11 (NPN_PopPopupsEnabledState): 12 Add stubs for these functions. 13 14 * Plugins/npfunctions.h: 15 Add new methods to NPNetscapeFuncs. 16 1 17 2007-03-29 Geoffrey Garen <ggaren@apple.com> 2 18 -
trunk/WebKit/Plugins/WebNetscapePluginPackage.m
r15902 r20613 378 378 browserFuncs.getJavaEnv = (NPN_GetJavaEnvProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_GetJavaEnv); 379 379 browserFuncs.getJavaPeer = (NPN_GetJavaPeerProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_GetJavaPeer); 380 380 browserFuncs.pushpopupsenabledstate = (NPN_PushPopupsEnabledStateProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PushPopupsEnabledState); 381 browserFuncs.poppopupsenabledstate = (NPN_PopPopupsEnabledStateProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PopPopupsEnabledState); 382 381 383 browserFuncs.releasevariantvalue = (NPN_ReleaseVariantValueProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_ReleaseVariantValue); 382 384 browserFuncs.getstringidentifier = (NPN_GetStringIdentifierProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_GetStringIdentifier); … … 395 397 browserFuncs.removeproperty = (NPN_RemovePropertyProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_RemoveProperty); 396 398 browserFuncs.setexception = (NPN_SetExceptionProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_SetException); 397 399 browserFuncs.enumerate = (NPN_EnumerateProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_Enumerate); 400 398 401 #if !LOG_DISABLED 399 402 CFAbsoluteTime mainStart = CFAbsoluteTimeGetCurrent(); … … 471 474 browserFuncs.getJavaEnv = NPN_GetJavaEnv; 472 475 browserFuncs.getJavaPeer = NPN_GetJavaPeer; 473 476 browserFuncs.pushpopupsenabledstate = NPN_PushPopupsEnabledState; 477 browserFuncs.poppopupsenabledstate = NPN_PopPopupsEnabledState; 478 474 479 browserFuncs.releasevariantvalue = _NPN_ReleaseVariantValue; 475 480 browserFuncs.getstringidentifier = _NPN_GetStringIdentifier; … … 488 493 browserFuncs.removeproperty = _NPN_RemoveProperty; 489 494 browserFuncs.setexception = _NPN_SetException; 495 browserFuncs.enumerate = _NPN_Enumerate; 490 496 491 497 #if !LOG_DISABLED -
trunk/WebKit/Plugins/npapi.m
r14105 r20613 159 159 return NULL; 160 160 } 161 162 void 163 NPN_PushPopupsEnabledState(NPP instance, NPBool enabled) 164 { 165 } 166 167 void 168 NPN_PopPopupsEnabledState(NPP instance) 169 { 170 } -
trunk/WebKit/Plugins/npfunctions.h
r16235 r20613 30 30 typedef void* (*NPN_GetJavaEnvProcPtr)(void); 31 31 typedef void* (*NPN_GetJavaPeerProcPtr)(NPP instance); 32 typedef void (*NPN_PushPopupsEnabledStateProcPtr)(NPP instance, NPBool enabled); 33 typedef void (*NPN_PopPopupsEnabledStateProcPtr)(NPP instance); 34 32 35 33 36 typedef void (*NPN_ReleaseVariantValueProcPtr) (NPVariant *variant); … … 52 55 typedef bool (*NPN_RemovePropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName); 53 56 typedef void (*NPN_SetExceptionProcPtr) (NPObject *obj, const NPUTF8 *message); 57 typedef bool (*NPN_EnumerateProcPtr) (NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count); 54 58 55 59 typedef NPError (*NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved); … … 116 120 NPN_ReleaseVariantValueProcPtr releasevariantvalue; 117 121 NPN_SetExceptionProcPtr setexception; 122 NPN_PushPopupsEnabledStateProcPtr pushpopupsenabledstate; 123 NPN_PopPopupsEnabledStateProcPtr poppopupsenabledstate; 124 NPN_EnumerateProcPtr enumerate; 118 125 } NPNetscapeFuncs; 119 126 -
trunk/WebKitTools/ChangeLog
r20597 r20613 1 2007-03-30 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Geoff. 4 5 * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: 6 Add TestObject.c and TestObject.h 7 8 * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c: 9 (pluginGetProperty): 10 Implement the testObject property. 11 12 (pluginInvoke): 13 Implement testEnumerate which takes an object and an array and enumerates 14 the properties of the object and adds them to the array. 15 16 (pluginAllocate): 17 Allocate the test object. 18 19 (pluginDeallocate): 20 Free the test object. 21 22 * DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.c: Added. 23 * DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h: Added. 24 Add a test object with two enumerable properties. 25 1 26 2007-03-29 Geoffrey Garen <ggaren@apple.com> 2 27 -
trunk/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
r20590 r20613 40 40 14A6FB8B0971CAE5008B014F /* NavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14A6FB890971CAE5008B014F /* NavigationController.m */; }; 41 41 1A6CA8DE0B7122D100A24B62 /* ResourceLoadDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A6CA8640B7120CF00A24B62 /* ResourceLoadDelegate.m */; }; 42 1A8F02E70BB9B4EC008CFA34 /* TestObject.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8F024D0BB9B056008CFA34 /* TestObject.c */; }; 43 1A8F02E80BB9B4EC008CFA34 /* TestObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8F024C0BB9B056008CFA34 /* TestObject.h */; }; 42 44 22181BD109DC8C4B008342E8 /* ObjCPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 22181BCD09DC8C4B008342E8 /* ObjCPlugin.h */; }; 43 45 22181BD209DC8C4B008342E8 /* ObjCPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 22181BCE09DC8C4B008342E8 /* ObjCPlugin.m */; }; … … 106 108 1A6CA8630B7120CF00A24B62 /* ResourceLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadDelegate.h; sourceTree = "<group>"; }; 107 109 1A6CA8640B7120CF00A24B62 /* ResourceLoadDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ResourceLoadDelegate.m; sourceTree = "<group>"; }; 110 1A8F024C0BB9B056008CFA34 /* TestObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestObject.h; sourceTree = "<group>"; }; 111 1A8F024D0BB9B056008CFA34 /* TestObject.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TestObject.c; sourceTree = "<group>"; }; 108 112 22181BCD09DC8C4B008342E8 /* ObjCPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ObjCPlugin.h; sourceTree = "<group>"; }; 109 113 22181BCE09DC8C4B008342E8 /* ObjCPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ObjCPlugin.m; sourceTree = "<group>"; }; … … 199 203 141BF446096A45C800E0753C /* PluginObject.c */, 200 204 141BF447096A45C800E0753C /* PluginObject.h */, 205 1A8F024D0BB9B056008CFA34 /* TestObject.c */, 206 1A8F024C0BB9B056008CFA34 /* TestObject.h */, 201 207 141BF448096A45C800E0753C /* Info.plist */, 202 208 ); … … 265 271 files = ( 266 272 141BF453096A45EB00E0753C /* PluginObject.h in Headers */, 273 1A8F02E80BB9B4EC008CFA34 /* TestObject.h in Headers */, 267 274 ); 268 275 runOnlyForDeploymentPostprocessing = 0; … … 356 363 isa = PBXProject; 357 364 buildConfigurationList = 149C29C308902C6D008A9EFC /* Build configuration list for PBXProject "DumpRenderTree" */; 358 compatibilityVersion = "Xcode 2.4";359 365 hasScannedForEncodings = 1; 360 366 mainGroup = 08FB7794FE84155DC02AAC07 /* DumpRenderTree */; … … 362 368 projectDirPath = ""; 363 369 projectRoot = ""; 364 shouldCheckCompatibility = 1;365 370 targets = ( 366 371 A84F608D08B1370600E9745F /* All */, … … 390 395 141BF44A096A45C800E0753C /* main.c in Sources */, 391 396 141BF44B096A45C800E0753C /* PluginObject.c in Sources */, 397 1A8F02E70BB9B4EC008CFA34 /* TestObject.c in Sources */, 392 398 ); 393 399 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c
r20597 r20613 32 32 */ 33 33 34 #import "PluginObject.h" 34 #include "PluginObject.h" 35 36 #include "TestObject.h" 37 #include <assert.h> 35 38 36 39 static void pluginInvalidate(NPObject *obj); … … 69 72 #define ID_PROPERTY_EVENT_LOGGING 1 70 73 #define ID_PROPERTY_HAS_STREAM 2 71 #define NUM_PROPERTY_IDENTIFIERS 3 74 #define ID_PROPERTY_TEST_OBJECT 3 75 #define NUM_PROPERTY_IDENTIFIERS 4 72 76 73 77 static NPIdentifier pluginPropertyIdentifiers[NUM_PROPERTY_IDENTIFIERS]; … … 75 79 "property", 76 80 "eventLoggingEnabled", 77 "hasStream" 81 "hasStream", 82 "testObject" 78 83 }; 79 84 … … 85 90 #define ID_TEST_INVOKE_DEFAULT 5 86 91 #define ID_DESTROY_STREAM 6 87 #define NUM_METHOD_IDENTIFIERS 7 92 #define ID_TEST_ENUMERATE 7 93 #define NUM_METHOD_IDENTIFIERS 8 88 94 89 95 static NPIdentifier pluginMethodIdentifiers[NUM_METHOD_IDENTIFIERS]; … … 95 101 "getURLNotify", 96 102 "testInvokeDefault", 97 "destroyStream" 103 "destroyStream", 104 "testEnumerate" 98 105 }; 99 106 … … 101 108 { 102 109 size_t length = NPVARIANT_TO_STRING(*variant).UTF8Length; 103 NPUTF8* result = malloc(length + 1);110 NPUTF8* result = (NPUTF8*)malloc(length + 1); 104 111 memcpy(result, NPVARIANT_TO_STRING(*variant).UTF8Characters, length); 105 112 result[length] = '\0'; … … 139 146 } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_HAS_STREAM]) { 140 147 BOOLEAN_TO_NPVARIANT(((PluginObject *)obj)->stream != 0, *variant); 148 return true; 149 } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_TEST_OBJECT]) { 150 NPObject *testObject = ((PluginObject *)obj)->testObject; 151 browser->retainobject(testObject); 152 OBJECT_TO_NPVARIANT(testObject, *variant); 141 153 return true; 142 154 } … … 181 193 if (argCount > 0 && NPVARIANT_IS_STRING(args[0])) { 182 194 NPObject *windowScriptObject; 183 browser->getvalue(obj->npp, NP PVpluginScriptableNPObject, &windowScriptObject);195 browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); 184 196 185 197 NPUTF8* callbackString = createCStringFromNPVariant(&args[0]); … … 249 261 250 262 BOOLEAN_TO_NPVARIANT(retval, *result); 251 return true; 263 return true; 264 } else if (name == pluginMethodIdentifiers[ID_TEST_ENUMERATE]) { 265 if (argCount == 2 && NPVARIANT_IS_OBJECT(args[0]) && NPVARIANT_IS_OBJECT(args[1])) { 266 uint32_t count; 267 NPIdentifier* identifiers; 268 269 if (browser->enumerate(obj->npp, NPVARIANT_TO_OBJECT(args[0]), &identifiers, &count)) { 270 NPObject* outArray = NPVARIANT_TO_OBJECT(args[1]); 271 NPIdentifier pushIdentifier = browser->getstringidentifier("push"); 272 273 for (uint32_t i = 0; i < count; i++) { 274 NPUTF8* string = browser->utf8fromidentifier(identifiers[i]); 275 276 if (!string) 277 continue; 278 279 NPVariant args[1]; 280 STRINGZ_TO_NPVARIANT(string, args[0]); 281 NPVariant browserResult; 282 browser->invoke(obj->npp, outArray, pushIdentifier, args, 1, &browserResult); 283 browser->releasevariantvalue(&browserResult); 284 } 285 286 browser->memfree(identifiers); 287 } 288 289 VOID_TO_NPVARIANT(*result); 290 return true; 291 } 252 292 } else if (name == pluginMethodIdentifiers[ID_DESTROY_STREAM]) { 253 293 assert(obj->stream); … … 256 296 return true; 257 297 } 258 259 298 return false; 260 299 } … … 272 311 static NPObject *pluginAllocate(NPP npp, NPClass *theClass) 273 312 { 274 PluginObject *newInstance = malloc(sizeof(PluginObject));313 PluginObject *newInstance = (PluginObject*)malloc(sizeof(PluginObject)); 275 314 276 315 if (!identifiersInitialized) { … … 280 319 281 320 newInstance->npp = npp; 321 newInstance->testObject = browser->createobject(npp, getTestClass()); 282 322 newInstance->eventLogging = FALSE; 283 323 newInstance->stream = 0; … … 286 326 } 287 327 288 static void pluginDeallocate(NPObject *obj) 289 { 290 free(obj); 328 static void pluginDeallocate(NPObject *header) 329 { 330 PluginObject* obj = (PluginObject*)header; 331 332 browser->releaseobject(obj->testObject); 333 334 free(header); 291 335 } 292 336 … … 298 342 299 343 NPObject *windowScriptObject; 300 browser->getvalue(object->npp, NP PVpluginScriptableNPObject, &windowScriptObject);344 browser->getvalue(object->npp, NPNVWindowNPObject, &windowScriptObject); 301 345 302 346 NPIdentifier callbackIdentifier = notifyData; -
trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h
r20597 r20613 26 26 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL 27 27 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 28 28 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 29 29 REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND 30 30 WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR … … 39 39 NPObject header; 40 40 NPP npp; 41 Boolean eventLogging; 41 NPBool eventLogging; 42 NPObject* testObject; 42 43 NPStream* stream; 43 44 } PluginObject;
Note: See TracChangeset
for help on using the changeset viewer.