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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 13 matching lines...) Expand all Loading... |
24 * | 24 * |
25 */ | 25 */ |
26 | 26 |
27 #ifndef CrossOriginPreflightResultCache_h | 27 #ifndef CrossOriginPreflightResultCache_h |
28 #define CrossOriginPreflightResultCache_h | 28 #define CrossOriginPreflightResultCache_h |
29 | 29 |
30 #include "core/fetch/ResourceLoaderOptions.h" | 30 #include "core/fetch/ResourceLoaderOptions.h" |
31 #include "platform/weborigin/KURLHash.h" | 31 #include "platform/weborigin/KURLHash.h" |
32 #include "wtf/HashMap.h" | 32 #include "wtf/HashMap.h" |
33 #include "wtf/HashSet.h" | 33 #include "wtf/HashSet.h" |
34 #include "wtf/PassOwnPtr.h" | |
35 #include "wtf/text/StringHash.h" | 34 #include "wtf/text/StringHash.h" |
| 35 #include <memory> |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 class HTTPHeaderMap; | 39 class HTTPHeaderMap; |
40 class ResourceResponse; | 40 class ResourceResponse; |
41 | 41 |
42 class CrossOriginPreflightResultCacheItem { | 42 class CrossOriginPreflightResultCacheItem { |
43 WTF_MAKE_NONCOPYABLE(CrossOriginPreflightResultCacheItem); USING_FAST_MALLOC
(CrossOriginPreflightResultCacheItem); | 43 WTF_MAKE_NONCOPYABLE(CrossOriginPreflightResultCacheItem); USING_FAST_MALLOC
(CrossOriginPreflightResultCacheItem); |
44 public: | 44 public: |
45 CrossOriginPreflightResultCacheItem(StoredCredentials credentials) | 45 CrossOriginPreflightResultCacheItem(StoredCredentials credentials) |
(...skipping 17 matching lines...) Expand all Loading... |
63 StoredCredentials m_credentials; | 63 StoredCredentials m_credentials; |
64 HashSet<String> m_methods; | 64 HashSet<String> m_methods; |
65 HeadersSet m_headers; | 65 HeadersSet m_headers; |
66 }; | 66 }; |
67 | 67 |
68 class CrossOriginPreflightResultCache { | 68 class CrossOriginPreflightResultCache { |
69 WTF_MAKE_NONCOPYABLE(CrossOriginPreflightResultCache); USING_FAST_MALLOC(Cro
ssOriginPreflightResultCache); | 69 WTF_MAKE_NONCOPYABLE(CrossOriginPreflightResultCache); USING_FAST_MALLOC(Cro
ssOriginPreflightResultCache); |
70 public: | 70 public: |
71 static CrossOriginPreflightResultCache& shared(); | 71 static CrossOriginPreflightResultCache& shared(); |
72 | 72 |
73 void appendEntry(const String& origin, const KURL&, PassOwnPtr<CrossOriginPr
eflightResultCacheItem>); | 73 void appendEntry(const String& origin, const KURL&, std::unique_ptr<CrossOri
ginPreflightResultCacheItem>); |
74 bool canSkipPreflight(const String& origin, const KURL&, StoredCredentials,
const String& method, const HTTPHeaderMap& requestHeaders); | 74 bool canSkipPreflight(const String& origin, const KURL&, StoredCredentials,
const String& method, const HTTPHeaderMap& requestHeaders); |
75 | 75 |
76 private: | 76 private: |
77 CrossOriginPreflightResultCache() { } | 77 CrossOriginPreflightResultCache() { } |
78 | 78 |
79 typedef HashMap<std::pair<String, KURL>, OwnPtr<CrossOriginPreflightResultCa
cheItem>> CrossOriginPreflightResultHashMap; | 79 typedef HashMap<std::pair<String, KURL>, std::unique_ptr<CrossOriginPrefligh
tResultCacheItem>> CrossOriginPreflightResultHashMap; |
80 | 80 |
81 CrossOriginPreflightResultHashMap m_preflightHashMap; | 81 CrossOriginPreflightResultHashMap m_preflightHashMap; |
82 }; | 82 }; |
83 | 83 |
84 } // namespace blink | 84 } // namespace blink |
85 | 85 |
86 #endif | 86 #endif |
OLD | NEW |