Bug 149762 - Allow WKRetainPtrs to be used as keys in hashing data structures
Summary: Allow WKRetainPtrs to be used as keys in hashing data structures
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords:
: 149763 (view as bug list)
Depends on: 149897
Blocks: 149218
  Show dependency treegraph
 
Reported: 2015-10-02 14:30 PDT by Myles C. Maxfield
Modified: 2016-07-01 17:07 PDT (History)
7 users (show)

See Also:


Attachments
Patch (10.13 KB, patch)
2015-10-02 14:44 PDT, Myles C. Maxfield
andersca: review+
Details | Formatted Diff | Diff

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