OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef FetchHeaderList_h | 5 #ifndef FetchHeaderList_h |
6 #define FetchHeaderList_h | 6 #define FetchHeaderList_h |
7 | 7 |
| 8 #include "platform/heap/Handle.h" |
8 #include "wtf/OwnPtr.h" | 9 #include "wtf/OwnPtr.h" |
9 #include "wtf/PassRefPtr.h" | 10 #include "wtf/PassRefPtr.h" |
10 #include "wtf/RefCounted.h" | 11 #include "wtf/RefCounted.h" |
11 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
12 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
13 #include <utility> | 14 #include <utility> |
14 | 15 |
15 namespace WebCore { | 16 namespace WebCore { |
16 | 17 |
| 18 class Header; |
| 19 |
17 // http://fetch.spec.whatwg.org/#terminology-headers | 20 // http://fetch.spec.whatwg.org/#terminology-headers |
18 class FetchHeaderList FINAL : public RefCounted<FetchHeaderList> { | 21 class FetchHeaderList FINAL : public RefCountedWillBeGarbageCollectedFinalized<F
etchHeaderList> { |
19 public: | 22 public: |
20 typedef std::pair<String, String> Header; | 23 typedef std::pair<String, String> Header; |
21 static PassRefPtr<FetchHeaderList> create(); | 24 static PassRefPtrWillBeRawPtr<FetchHeaderList> create(); |
22 PassRefPtr<FetchHeaderList> createCopy(); | 25 PassRefPtrWillBeRawPtr<FetchHeaderList> createCopy(); |
23 | 26 |
24 ~FetchHeaderList(); | 27 ~FetchHeaderList(); |
25 void append(const String&, const String&); | 28 void append(const String&, const String&); |
26 void set(const String&, const String&); | 29 void set(const String&, const String&); |
27 // FIXME: Implement parse() | 30 // FIXME: Implement parse() |
28 // FIXME: Implement extractMIMEType() | 31 // FIXME: Implement extractMIMEType() |
29 | 32 |
30 size_t size() const; | 33 size_t size() const; |
31 void remove(const String&); | 34 void remove(const String&); |
32 bool get(const String&, String&) const; | 35 bool get(const String&, String&) const; |
33 void getAll(const String&, Vector<String>&) const; | 36 void getAll(const String&, Vector<String>&) const; |
34 bool has(const String&) const; | 37 bool has(const String&) const; |
35 void clearList(); | 38 void clearList(); |
36 | 39 |
37 const Vector<OwnPtr<Header> >& list() const { return m_headerList; } | 40 const Vector<OwnPtr<Header> >& list() const { return m_headerList; } |
38 | 41 |
39 static bool isValidHeaderName(const String&); | 42 static bool isValidHeaderName(const String&); |
40 static bool isValidHeaderValue(const String&); | 43 static bool isValidHeaderValue(const String&); |
41 static bool isSimpleHeader(const String&, const String&); | 44 static bool isSimpleHeader(const String&, const String&); |
42 static bool isForbiddenHeaderName(const String&); | 45 static bool isForbiddenHeaderName(const String&); |
43 static bool isForbiddenResponseHeaderName(const String&); | 46 static bool isForbiddenResponseHeaderName(const String&); |
44 | 47 |
| 48 void trace(Visitor*) { } |
| 49 |
45 private: | 50 private: |
46 FetchHeaderList(); | 51 FetchHeaderList(); |
47 Vector<OwnPtr<Header> > m_headerList; | 52 Vector<OwnPtr<Header> > m_headerList; |
48 }; | 53 }; |
49 | 54 |
50 } // namespace WebCore | 55 } // namespace WebCore |
51 | 56 |
52 #endif // FetchHeaderList_h | 57 #endif // FetchHeaderList_h |
OLD | NEW |