Bug 110170 - Add a DefaultHash for RefPtr<SecurityOrigin>
Summary: Add a DefaultHash for RefPtr<SecurityOrigin>
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-18 18:02 PST by Anders Carlsson
Modified: 2013-02-18 19:17 PST (History)
4 users (show)

See Also:


Attachments
Patch (15.81 KB, patch)
2013-02-18 18:16 PST, Anders Carlsson
no flags Details | Formatted Diff | Diff

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