ObjcClass::methodsNamed() can leak if buffer is dynamically allocated
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Apr 2012 21:07:56 +0000 (21:07 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Apr 2012 21:07:56 +0000 (21:07 +0000)
commit010824288e92c3a60909f58468d28ed3f786d3e4
tree7193e763b56998d880a4ac1f273ad38e75871963
parent52d8e8f973e39711d501535546d3f847b41fd434
ObjcClass::methodsNamed() can leak if buffer is dynamically allocated
https://bugs.webkit.org/show_bug.cgi?id=84668

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-04-26
Reviewed by Alexey Proskuryakov.

Source/WebCore:

Change ObjcClass::methodsNamed() to be based on a vector instead of managing
the memory manually.

Tests: platform/mac/plugins/bindings-objc-long-method-name.html
       platform/mac/plugins/bindings-objc-method-name-conversion.html

* bridge/objc/objc_class.mm:
(Bindings):
(JSC::Bindings::convertJSMethodNameToObjc):
(JSC::Bindings::ObjcClass::methodsNamed):

Tools:

Extend ObjCPlugin to support the new layout tests of the Objective-C bridge.

* DumpRenderTree/mac/ObjCPlugin.m:
(+[ObjCPlugin isSelectorExcludedFromWebScript:]):
(+[ObjCPlugin webScriptNameForSelector:]):
(-[ObjCPlugin methodMappedToLongName]):
(-[ObjCPlugin testConversionColon:]):
(-[ObjCPlugin _:]):

LayoutTests:

Extend the test coverage to accessor with very long name. Add coverage for the
JavaScript to Objective-C method name conversion.

* platform/mac/plugins/bindings-objc-long-method-name-expected.txt: Added.
* platform/mac/plugins/bindings-objc-long-method-name.html: Added.
* platform/mac/plugins/bindings-objc-method-name-conversion-expected.txt: Added.
* platform/mac/plugins/bindings-objc-method-name-conversion.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/plugins/bindings-objc-long-method-name-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/plugins/bindings-objc-long-method-name.html [new file with mode: 0644]
LayoutTests/platform/mac/plugins/bindings-objc-method-name-conversion-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/plugins/bindings-objc-method-name-conversion.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bridge/objc/objc_class.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/ObjCPlugin.m