OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 13 matching lines...) Expand all Loading... |
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #ifndef SecurityOriginHash_h | 29 #ifndef SecurityOriginHash_h |
30 #define SecurityOriginHash_h | 30 #define SecurityOriginHash_h |
31 | 31 |
32 #include "platform/weborigin/KURL.h" | 32 #include "platform/weborigin/KURL.h" |
33 #include "platform/weborigin/SecurityOrigin.h" | 33 #include "platform/weborigin/SecurityOrigin.h" |
34 #include "wtf/Allocator.h" | 34 #include "platform/wtf/Allocator.h" |
35 #include "wtf/RefPtr.h" | 35 #include "platform/wtf/RefPtr.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 struct SecurityOriginHash { | 39 struct SecurityOriginHash { |
40 STATIC_ONLY(SecurityOriginHash); | 40 STATIC_ONLY(SecurityOriginHash); |
41 static unsigned hash(SecurityOrigin* origin) { | 41 static unsigned hash(SecurityOrigin* origin) { |
42 unsigned hashCodes[4] = { | 42 unsigned hashCodes[4] = { |
43 origin->protocol().impl() ? origin->protocol().impl()->hash() : 0, | 43 origin->protocol().impl() ? origin->protocol().impl()->hash() : 0, |
44 origin->host().impl() ? origin->host().impl()->hash() : 0, | 44 origin->host().impl() ? origin->host().impl()->hash() : 0, |
45 origin->port(), (origin->suborigin()->name().impl()) | 45 origin->port(), (origin->suborigin()->name().impl()) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 namespace WTF { | 88 namespace WTF { |
89 | 89 |
90 template <> | 90 template <> |
91 struct DefaultHash<RefPtr<blink::SecurityOrigin>> { | 91 struct DefaultHash<RefPtr<blink::SecurityOrigin>> { |
92 typedef blink::SecurityOriginHash Hash; | 92 typedef blink::SecurityOriginHash Hash; |
93 }; | 93 }; |
94 | 94 |
95 } // namespace WTF | 95 } // namespace WTF |
96 | 96 |
97 #endif // SecurityOriginHash_h | 97 #endif // SecurityOriginHash_h |
OLD | NEW |