Bug 40938 - RetainPtr can't be used in HashMaps or HashSets
Summary: RetainPtr can't be used in HashMaps or HashSets
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: John Sullivan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-21 13:38 PDT by John Sullivan
Modified: 2010-06-21 14:04 PDT (History)
1 user (show)

See Also:


Attachments
Patch that mimics COMPtr.h's handling of hashing code. (3.33 KB, patch)
2010-06-21 13:43 PDT, John Sullivan
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Sullivan 2010-06-21 13:38:31 PDT
The RetainPtr smart pointer class can't be used in HashMaps or HashSets. It needs hashing code like that in RefPtr and COMPtr.
Comment 1 John Sullivan 2010-06-21 13:43:35 PDT
Created attachment 59283 [details]
Patch that mimics COMPtr.h's handling of hashing code.
Comment 2 WebKit Review Bot 2010-06-21 13:49:21 PDT
Attachment 59283 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1
JavaScriptCore/wtf/RetainPtr.h:219:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Adam Roben (:aroben) 2010-06-21 13:52:17 PDT
Comment on attachment 59283 [details]
Patch that mimics COMPtr.h's handling of hashing code.

> +++ JavaScriptCore/wtf/RetainPtr.h	(working copy)
> @@ -24,6 +24,7 @@
>  #include "TypeTraits.h"
>  #include <algorithm>
>  #include <CoreFoundation/CoreFoundation.h>
> +#include <WTF/HashTraits.h>

It looks like intra-WTF includes are supposed to use quotes and no wtf/ prefix:

#include "HashTraits.h"

r=me
Comment 4 John Sullivan 2010-06-21 13:58:40 PDT
The style complaint is a false positive. I filed <https://bugs.webkit.org/show_bug.cgi?id=40941>.
Comment 5 John Sullivan 2010-06-21 14:04:43 PDT
Fixed in http://trac.webkit.org/changeset/61576