Bug 143933

Summary: [WK2] Have API::Array creation methods return Ref<>
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Zan Dobersek 2015-04-19 00:40:05 PDT
[WK2] Have API::Array creation methods return Ref<>
Comment 1 Zan Dobersek 2015-04-19 00:48:42 PDT
Created attachment 251117 [details]
Patch
Comment 2 Darin Adler 2015-04-19 16:50:23 PDT
Comment on attachment 251117 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=251117&action=review

> Source/WebKit2/Shared/API/APIArray.h:33
> +#include <wtf/Ref.h>

I think that <wtf/Forward.h> should suffice. We don’t really need to include Ref just to compile a function definition that returns a Ref<X>.

> Source/WebKit2/Shared/API/c/WKDictionary.cpp:62
> +    Ref<API::Array> keys = toImpl(dictionaryRef)->keys();
> +    return toAPI(&keys.leakRef());

I don’t think we need this local variable.

> Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.mm:78
> +    Ref<API::Array> list = _list->backList();
> +    return [wrapper(list.leakRef()) autorelease];

Doesn’t seem like we need the two lines here.

> Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.mm:84
> +    Ref<API::Array> list = _list->forwardList();
> +    return [wrapper(list.leakRef()) autorelease];

Doesn’t seem like we need the two lines here.
Comment 3 Zan Dobersek 2015-04-22 05:26:11 PDT
Created attachment 251309 [details]
Patch for landing
Comment 4 Zan Dobersek 2015-04-22 08:29:24 PDT
Comment on attachment 251309 [details]
Patch for landing

Clearing flags on attachment: 251309

Committed r183105: <http://trac.webkit.org/changeset/183105>
Comment 5 Zan Dobersek 2015-04-22 08:29:31 PDT
All reviewed patches have been landed.  Closing bug.