Changeset 88679 in webkit
- Timestamp:
- Jun 13, 2011 1:19:07 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r88678 r88679 1 2011-06-13 Nate Chapin <japhet@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Test for https://bugs.webkit.org/show_bug.cgi?id=61482, 6 mostly written by Kelly Norton (knorton@google.com). 7 8 * plugins/npruntime/embed-property-equality-expected.txt: Added. 9 * plugins/npruntime/embed-property-equality.html: Added. 10 1 11 2011-06-13 Julien Chaffraix <jchaffraix@webkit.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r88674 r88679 1 2011-06-13 Nate Chapin <japhet@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 [V8] Cache V8NPObjects so that we don't create multiple 6 NPObjects for the same v8::Object. 7 https://bugs.webkit.org/show_bug.cgi?id=61482 8 9 Test: plugins/npruntime/embed-property-equality.html 10 11 * bindings/v8/NPV8Object.cpp: 12 (WebCore::freeV8NPObject): 13 (WebCore::npCreateV8ScriptObject): 14 1 15 2011-06-13 Xan Lopez <xlopez@igalia.com> 2 16 -
trunk/Source/WebCore/bindings/v8/NPV8Object.cpp
r88615 r88679 62 62 } 63 63 64 typedef HashMap<int, V8NPObject*> V8NPObjectMap; 65 66 static V8NPObjectMap* staticV8NPObjectMap() 67 { 68 DEFINE_STATIC_LOCAL(V8NPObjectMap, v8npObjectMap, ()); 69 return &v8npObjectMap; 70 } 71 64 72 // FIXME: Comments on why use malloc and free. 65 73 static NPObject* allocV8NPObject(NPP, NPClass*) … … 71 79 { 72 80 V8NPObject* v8NpObject = reinterpret_cast<V8NPObject*>(npObject); 81 if (int v8ObjectHash = v8NpObject->v8Object->GetIdentityHash()) { 82 ASSERT(staticV8NPObjectMap()->contains(v8ObjectHash)); 83 staticV8NPObjectMap()->remove(v8ObjectHash); 84 } else { 85 ASSERT(!v8::Context::InContext()); 86 staticV8NPObjectMap()->clear(); 87 } 88 73 89 #ifndef NDEBUG 74 90 V8GCController::unregisterGlobalHandle(v8NpObject, v8NpObject->v8Object); … … 124 140 return returnValue; 125 141 } 142 } 143 144 int v8ObjectHash = object->GetIdentityHash(); 145 ASSERT(v8ObjectHash); 146 if (staticV8NPObjectMap()->contains(v8ObjectHash)) { 147 V8NPObject* v8npObject = staticV8NPObjectMap()->get(v8ObjectHash); 148 ASSERT(v8npObject->v8Object == object); 149 _NPN_RetainObject(&v8npObject->object); 150 return reinterpret_cast<NPObject*>(v8npObject); 126 151 } 127 152 … … 132 157 #endif 133 158 v8npObject->rootObject = root; 159 160 staticV8NPObjectMap()->set(v8ObjectHash, v8npObject); 161 134 162 return reinterpret_cast<NPObject*>(v8npObject); 135 163 } -
trunk/Tools/ChangeLog
r88671 r88679 1 2011-06-13 Nate Chapin <japhet@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 New test method on TestNetscapePlugin for https://bugs.webkit.org/show_bug.cgi?id=61482. 6 7 * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp: 8 1 9 2011-06-13 Dirk Pranke <dpranke@chromium.org> 2 10 -
trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
r83300 r88679 206 206 ID_NORMALIZE, 207 207 ID_INVALIDATE_RECT, 208 ID_OBJECTS_ARE_SAME, 208 209 NUM_METHOD_IDENTIFIERS 209 210 }; … … 247 248 "resizeTo", 248 249 "normalize", 249 "invalidateRect" 250 "invalidateRect", 251 "objectsAreSame" 250 252 }; 251 253 … … 1006 1008 1007 1009 browser->invalidaterect(obj->npp, &rect); 1010 return true; 1011 } 1012 1013 static bool objectsAreSame(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) 1014 { 1015 if (argCount != 2 || !NPVARIANT_IS_OBJECT(args[0]) || !NPVARIANT_IS_OBJECT(args[1])) 1016 return false; 1017 1018 BOOLEAN_TO_NPVARIANT(NPVARIANT_TO_OBJECT(args[0]) == NPVARIANT_TO_OBJECT(args[1]), *result); 1008 1019 return true; 1009 1020 } … … 1125 1136 if (name == pluginMethodIdentifiers[ID_INVALIDATE_RECT]) 1126 1137 return invalidateRect(plugin, args, argCount, result); 1138 if (name == pluginMethodIdentifiers[ID_OBJECTS_ARE_SAME]) 1139 return objectsAreSame(plugin, args, argCount, result); 1127 1140 1128 1141 return false;
Note: See TracChangeset
for help on using the changeset viewer.