Bug 149762

Summary: Allow WKRetainPtrs to be used as keys in hashing data structures
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: New BugsAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, commit-queue, dino, jonlee, sam, simon.fraser, thorton
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 149897    
Bug Blocks: 149218    
Attachments:
Description Flags
Patch andersca: review+

Description Myles C. Maxfield 2015-10-02 14:30:04 PDT
Allow WKRetainPtrs to be used as keys in hashing data structures
Comment 1 Myles C. Maxfield 2015-10-02 14:42:56 PDT
*** Bug 149763 has been marked as a duplicate of this bug. ***
Comment 2 Myles C. Maxfield 2015-10-02 14:44:59 PDT
Created attachment 262353 [details]
Patch
Comment 3 Myles C. Maxfield 2015-10-02 14:45:18 PDT
*** Bug 149763 has been marked as a duplicate of this bug. ***
Comment 4 Anders Carlsson 2015-10-05 10:19:20 PDT
Comment on attachment 262353 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKit2/WKRetainPtr.cpp:40
> +    WKRetainPtr<WKContextRef> context1 = adoptWK(WKContextCreate());
> +    WKRetainPtr<WKContextRef> context2 = adoptWK(WKContextCreate());
> +    WKRetainPtr<WKContextRef> context3 = adoptWK(WKContextCreate());
> +    WKRetainPtr<WKContextRef> context4 = adoptWK(WKContextCreate());

I'd use WKStringRef here instead of WKContextRef, for two reasons:

1. WKContextRefs are expensive to make.
2. Using WKStringRefs with two identical strings will test that it's pointer equality and not value equality that's used when putting WKRetainPtrs in hash maps.
Comment 5 Myles C. Maxfield 2015-10-05 13:32:12 PDT
Committed r190572: <http://trac.webkit.org/changeset/190572>
Comment 6 Darin Adler 2015-10-06 09:20:02 PDT
Comment on attachment 262353 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKit2/WKRetainPtr.cpp:2
> + * Copyright (C) 2011 Apple Inc. All rights reserved.

Surely the year is 2015.
Comment 7 Myles C. Maxfield 2015-10-06 13:27:27 PDT
(In reply to comment #6)
> Comment on attachment 262353 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=262353&action=review
> 
> > Tools/TestWebKitAPI/Tests/WebKit2/WKRetainPtr.cpp:2
> > + * Copyright (C) 2011 Apple Inc. All rights reserved.
> 
> Surely the year is 2015.

Committed r190639: <http://trac.webkit.org/changeset/190639>
Comment 8 WebKit Commit Bot 2015-10-07 14:29:24 PDT
Re-opened since this is blocked by bug 149897