Changeset 164077 in webkit
- Timestamp:
- Feb 13, 2014 5:06:53 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSValue.mm
r163844 r164077 38 38 #import "JSCInlines.h" 39 39 #import "JSCJSValue.h" 40 #import "Strong.h" 40 41 #import <wtf/HashMap.h> 41 42 #import <wtf/HashSet.h> … … 596 597 HashMap<JSValueRef, id> m_objectMap; 597 598 Vector<Task> m_worklist; 599 Vector<JSC::Strong<JSC::Unknown>> m_jsValues; 598 600 }; 599 601 … … 612 614 void JSContainerConvertor::add(Task task) 613 615 { 616 JSC::ExecState* exec = toJS(m_context); 617 m_jsValues.append(JSC::Strong<JSC::Unknown>(exec->vm(), toJS(exec, task.js))); 614 618 m_objectMap.add(task.js, task.objc); 615 619 if (task.type != ContainerNone) … … 818 822 HashMap<id, JSValueRef> m_objectMap; 819 823 Vector<Task> m_worklist; 824 Vector<JSC::Strong<JSC::Unknown>> m_jsValues; 820 825 }; 821 826 … … 835 840 void ObjcContainerConvertor::add(ObjcContainerConvertor::Task task) 836 841 { 842 JSC::ExecState* exec = toJS(m_context.JSGlobalContextRef); 843 m_jsValues.append(JSC::Strong<JSC::Unknown>(exec->vm(), toJS(exec, task.js))); 837 844 m_objectMap.add(task.objc, task.js); 838 845 if (task.type != ContainerNone) -
trunk/Source/JavaScriptCore/ChangeLog
r164074 r164077 1 2014-02-13 Mark Lam <mark.lam@apple.com> 2 3 The JSContainerConvertor and ObjcContainerConvertor need to protect JSValueRefs. 4 <https://webkit.org/b/128764> 5 6 Reviewed by Mark Hahnenberg. 7 8 Added a vector of Strong<Unknown> references in the 2 containers, and append 9 the newly created JSValues to those vectors. This will keep all those JS objects 10 alive for the duration of the conversion. 11 12 * API/JSValue.mm: 13 (JSContainerConvertor::add): 14 (ObjcContainerConvertor::add): 15 1 16 2014-02-13 Matthew Mirman <mmirman@apple.com> 2 17
Note: See TracChangeset
for help on using the changeset viewer.