Changeset 154708 in webkit
- Timestamp:
- Aug 27, 2013 2:26:58 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r154707 r154708 1 2013-08-27 Anders Carlsson <andersca@apple.com> 2 3 Stop using deleteAllValues in CClass 4 https://bugs.webkit.org/show_bug.cgi?id=120376 5 6 Reviewed by Andreas Kling. 7 8 * bridge/c/c_class.cpp: 9 (JSC::Bindings::CClass::CClass): 10 (JSC::Bindings::CClass::~CClass): 11 (JSC::Bindings::CClass::methodNamed): 12 (JSC::Bindings::CClass::fieldNamed): 13 * bridge/c/c_class.h: 14 * bridge/jsc/BridgeJSC.h: 15 1 16 2013-08-27 Benjamin Poulain <benjamin@webkit.org> 2 17 -
trunk/Source/WebCore/bridge/c/c_class.cpp
r129969 r154708 42 42 CClass::CClass(NPClass* aClass) 43 43 { 44 _isa = aClass;44 m_isa = aClass; 45 45 } 46 46 47 47 CClass::~CClass() 48 48 { 49 deleteAllValues(_methods); 50 _methods.clear(); 51 52 deleteAllValues(_fields); 53 _fields.clear(); 49 m_methods.clear(); 50 m_fields.clear(); 54 51 } 55 52 … … 75 72 String name(propertyName.publicName()); 76 73 77 if (Method* method = _methods.get(name.impl()))74 if (Method* method = m_methods.get(name.impl())) 78 75 return method; 79 76 … … 81 78 const CInstance* inst = static_cast<const CInstance*>(instance); 82 79 NPObject* obj = inst->getObject(); 83 if ( _isa->hasMethod && _isa->hasMethod(obj, ident)){84 Method* method = new CMethod(ident); // deleted in the CClass destructor85 _methods.set(name.impl(), method);86 return method ;80 if (m_isa->hasMethod && m_isa->hasMethod(obj, ident)) { 81 OwnPtr<Method> method = adoptPtr(new CMethod(ident)); 82 m_methods.set(name.impl(), method.release()); 83 return method.get(); 87 84 } 88 85 … … 94 91 String name(propertyName.publicName()); 95 92 96 Field* aField = _fields.get(name.impl()); 97 if (aField) 98 return aField; 99 93 if (Field* field = m_fields.get(name.impl())) 94 return field; 95 100 96 NPIdentifier ident = _NPN_GetStringIdentifier(name.ascii().data()); 101 97 const CInstance* inst = static_cast<const CInstance*>(instance); 102 98 NPObject* obj = inst->getObject(); 103 if ( _isa->hasProperty && _isa->hasProperty(obj, ident)){104 aField = new CField(ident); // deleted in the CClass destructor105 _fields.set(name.impl(), aField);99 if (m_isa->hasProperty && m_isa->hasProperty(obj, ident)) { 100 OwnPtr<Field> field = adoptPtr(new CField(ident)); 101 m_fields.set(name.impl(), field.release()); 106 102 } 107 return aField; 103 104 return 0; 108 105 } 109 106 -
trunk/Source/WebCore/bridge/c/c_class.h
r129969 r154708 48 48 49 49 private: 50 NPClass* _isa;51 mutable MethodMap_methods;52 mutable FieldMap_fields;50 NPClass* m_isa; 51 mutable HashMap<RefPtr<StringImpl>, OwnPtr<Method>> m_methods; 52 mutable HashMap<RefPtr<StringImpl>, OwnPtr<Field>> m_fields; 53 53 }; 54 54 -
trunk/Source/WebCore/bridge/jsc/BridgeJSC.h
r154373 r154708 135 135 const char* signatureForParameters(const ArgList&); 136 136 137 typedef HashMap<RefPtr<StringImpl>, Method*> MethodMap;138 typedef HashMap<RefPtr<StringImpl>, Field*> FieldMap;139 140 137 } // namespace Bindings 141 138
Note: See TracChangeset
for help on using the changeset viewer.