Changeset 86206 in webkit
- Timestamp:
- May 10, 2011 7:11:56 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r86198 r86206 1 2011-05-10 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Geoffrey Garen. 4 5 Assertion failure in JSC::Structure::typeInfo when reloading weather.com video page 6 https://bugs.webkit.org/show_bug.cgi?id=60580 7 8 The plugin object map was incorrect trying to implement a weak map itself using 9 destructors. Switch to a WeakGCMap and the problem is fixed. 10 11 * WebProcess/Plugins/Netscape/JSNPObject.cpp: 12 (WebKit::JSNPObject::~JSNPObject): 13 * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: 14 (WebKit::NPRuntimeObjectMap::getOrCreateJSObject): 15 (WebKit::NPRuntimeObjectMap::invalidate): 16 * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: 17 1 18 2011-05-10 Sam Weinig <sam@webkit.org> 2 19 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
r81272 r86206 67 67 if (!m_npObject) 68 68 return; 69 70 m_objectMap->jsNPObjectDestroyed(this);71 69 releaseNPObject(m_npObject); 72 70 } -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
r83390 r86206 100 100 101 101 JSNPObject* jsNPObject = new (&globalObject->globalData()) JSNPObject(globalObject, this, npObject); 102 m_jsNPObjects.set( npObject, jsNPObject);102 m_jsNPObjects.set(globalObject->globalData(), npObject, jsNPObject); 103 103 104 104 return jsNPObject; 105 }106 107 void NPRuntimeObjectMap::jsNPObjectDestroyed(JSNPObject* jsNPObject)108 {109 // Remove the object from the map.110 ASSERT(m_jsNPObjects.contains(jsNPObject->npObject()));111 m_jsNPObjects.remove(jsNPObject->npObject());112 105 } 113 106 … … 225 218 ASSERT(m_npJSObjects.isEmpty()); 226 219 227 Vector<JSNPObject*> jsNPObjects; 228 copyValuesToVector(m_jsNPObjects, jsNPObjects); 229 230 // Invalidate all the JSObjects that wrap NPObjects. 231 for (size_t i = 0; i < jsNPObjects.size(); ++i) 232 jsNPObjects[i]->invalidate(); 233 220 WeakGCMap<NPObject*, JSNPObject>::iterator end = m_jsNPObjects.end(); 221 for (WeakGCMap<NPObject*, JSNPObject>::iterator ptr = m_jsNPObjects.begin(); ptr != end; ++ptr) 222 ptr.get().second->invalidate(); 234 223 m_jsNPObjects.clear(); 235 224 } -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h
r78634 r86206 27 27 #define NPJSObjectWrapperMap_h 28 28 29 #include <JavaScriptCore/WeakGCMap.h> 29 30 #include <wtf/Forward.h> 30 31 #include <wtf/HashMap.h> … … 88 89 89 90 HashMap<JSC::JSObject*, NPJSObject*> m_npJSObjects; 90 HashMap<NPObject*, JSNPObject*> m_jsNPObjects;91 JSC::WeakGCMap<NPObject*, JSNPObject> m_jsNPObjects; 91 92 }; 92 93
Note: See TracChangeset
for help on using the changeset viewer.