[webkit-dev] JSRetainPtr and JSStringRef

Adam Roben aroben at apple.com
Wed Dec 15 08:42:19 PST 2010


On Dec 15, 2010, at 9:13 AM, John Knottenbelt wrote:

> I'm looking at adding a method on the LayoutTestController in DumpRenderTree that will return a string. I see that some methods there return JSRetainPtr<JSStringRef> and some just return JSStringRef. 
> 
> Can anybody comment on when it is appropriate to return JSRetainPtr vs plain JSStringRef?

JSRetainPtr<JSStringRef> should be used any time it is the responsibility of the caller to release the JSStringRef. Otherwise it is fine to use a plain JSStringRef.

-Adam

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20101215/aee27ad3/attachment.html>


More information about the webkit-dev mailing list