Bug 143933 - [WK2] Have API::Array creation methods return Ref<>
Summary: [WK2] Have API::Array creation methods return Ref<>
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-19 00:40 PDT by Zan Dobersek
Modified: 2015-04-22 08:29 PDT (History)
0 users

See Also:


Attachments
Patch (58.89 KB, patch)
2015-04-19 00:48 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch for landing (58.80 KB, patch)
2015-04-22 05:26 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.