Bug 44221 - Add ability to get all the keys from a WKDictionaryRef
Summary: Add ability to get all the keys from a WKDictionaryRef
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-18 17:07 PDT by Sam Weinig
Modified: 2010-08-19 08:48 PDT (History)
1 user (show)

See Also:


Attachments
Patch (3.72 KB, patch)
2010-08-18 17:07 PDT, Sam Weinig
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2010-08-18 17:07:06 PDT
Add ability to get all the keys from a WKDictionaryRef
Comment 1 Sam Weinig 2010-08-18 17:07:53 PDT
Created attachment 64790 [details]
Patch
Comment 2 Adam Roben (:aroben) 2010-08-18 21:41:19 PDT
Comment on attachment 64790 [details]
Patch

> +PassRefPtr<ImmutableArray> ImmutableDictionary::keys()

Can this be a const member function?

> +    size_t size = m_map.size();
> +    if (!size)

I thought we used isEmpty() for things like this.

> +    APIObject** array = new APIObject*[size];

I think using OwnArrayPtr would be better. Or, if not, why not make the type APIObject*[]?

> +    return ImmutableArray::adopt(array, size);

And this should take a PassOwnPtr!

r=me
Comment 3 Sam Weinig 2010-08-19 08:48:24 PDT
Landed in r65675.