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 "wtf/OwnPtr.h" | 8 #include "wtf/OwnPtr.h" |
9 #include "wtf/PassRefPtr.h" | 9 #include "wtf/PassRefPtr.h" |
10 #include "wtf/RefCounted.h" | 10 #include "wtf/RefCounted.h" |
11 #include "wtf/Vector.h" | 11 #include "wtf/Vector.h" |
12 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
13 #include <utility> | 13 #include <utility> |
14 | 14 |
15 namespace WebCore { | 15 namespace WebCore { |
16 | 16 |
17 // http://fetch.spec.whatwg.org/#terminology-headers | 17 // http://fetch.spec.whatwg.org/#terminology-headers |
18 class FetchHeaderList FINAL : public RefCounted<FetchHeaderList> { | 18 class FetchHeaderList FINAL : public RefCounted<FetchHeaderList> { |
19 public: | 19 public: |
20 typedef std::pair<String, String> Header; | 20 typedef std::pair<String, String> Header; |
21 static PassRefPtr<FetchHeaderList> create(); | 21 static PassRefPtr<FetchHeaderList> create(); |
| 22 PassRefPtr<FetchHeaderList> createCopy(); |
22 | 23 |
23 ~FetchHeaderList(); | 24 ~FetchHeaderList(); |
24 void append(const String&, const String&); | 25 void append(const String&, const String&); |
25 void set(const String&, const String&); | 26 void set(const String&, const String&); |
26 // FIXME: Implement parse() | 27 // FIXME: Implement parse() |
27 // FIXME: Implement extractMIMEType() | 28 // FIXME: Implement extractMIMEType() |
28 | 29 |
29 size_t size() const; | 30 size_t size() const; |
30 void remove(const String&); | 31 void remove(const String&); |
31 bool get(const String&, String&) const; | 32 bool get(const String&, String&) const; |
(...skipping 10 matching lines...) Expand all Loading... |
42 static bool isForbiddenResponseHeaderName(const String&); | 43 static bool isForbiddenResponseHeaderName(const String&); |
43 | 44 |
44 private: | 45 private: |
45 FetchHeaderList(); | 46 FetchHeaderList(); |
46 Vector<OwnPtr<Header> > m_headerList; | 47 Vector<OwnPtr<Header> > m_headerList; |
47 }; | 48 }; |
48 | 49 |
49 } // namespace WebCore | 50 } // namespace WebCore |
50 | 51 |
51 #endif // FetchHeaderList_h | 52 #endif // FetchHeaderList_h |
OLD | NEW |