Bug 110170

Summary: Add a DefaultHash for RefPtr<SecurityOrigin>
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, japhet, kling, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Anders Carlsson 2013-02-18 18:02:24 PST
Add a DefaultHash for RefPtr<SecurityOrigin>
Comment 1 Anders Carlsson 2013-02-18 18:16:17 PST
Created attachment 188972 [details]
Patch
Comment 2 Andreas Kling 2013-02-18 18:20:11 PST
Comment on attachment 188972 [details]
Patch

Fabulous! r=me. Might wanna let EWS chew on it.
Comment 3 WebKit Review Bot 2013-02-18 18:21:13 PST
Attachment 188972 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/Modules/webdatabase/DatabaseTracker.h', u'Source/WebCore/Modules/webdatabase/OriginQuotaManager.h', u'Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp', u'Source/WebCore/loader/cache/MemoryCache.h', u'Source/WebCore/page/SecurityOriginHash.h', u'Source/WebCore/storage/StorageNamespaceImpl.h', u'Source/WebKit/mac/ChangeLog', u'Source/WebKit/mac/WebCoreSupport/WebApplicationCache.mm', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/UIProcess/Storage/StorageManager.cpp', u'Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp', u'Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp', u'Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h', u'Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp', u'Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h']" exit_code: 1
Source/WebCore/page/SecurityOriginHash.h:82:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 1 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 WebKit Review Bot 2013-02-18 18:57:09 PST
Comment on attachment 188972 [details]
Patch

Clearing flags on attachment: 188972

Committed r143287: <http://trac.webkit.org/changeset/143287>
Comment 5 WebKit Review Bot 2013-02-18 18:57:12 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Darin Adler 2013-02-18 18:59:10 PST
Seems a little strange for a RefPtr to hash by what’s pointed to rather than the pointer by default. Should we do this for other classes like RefPtr<StringImpl> too?
Comment 7 Darin Adler 2013-02-18 19:12:59 PST
Does compilation fail if you forget to include "SecurityOriginHash.h"?
Comment 8 Andreas Kling 2013-02-18 19:17:44 PST
(In reply to comment #6)
> Seems a little strange for a RefPtr to hash by what’s pointed to rather than the pointer by default. Should we do this for other classes like RefPtr<StringImpl> too?

This is already the case. From StringImpl.h:

// StringHash is the default hash for StringImpl* and RefPtr<StringImpl>
template<typename T> struct DefaultHash;
template<> struct DefaultHash<StringImpl*> {
    typedef StringHash Hash;
};
template<> struct DefaultHash<RefPtr<StringImpl> > {
    typedef StringHash Hash;
};