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
3 // found in the LICENSE file.
5 #ifndef FetchHeaderList_h
6 #define FetchHeaderList_h
8 #include "platform/heap/Handle.h"
9 #include "wtf/OwnPtr.h"
10 #include "wtf/PassRefPtr.h"
11 #include "wtf/Vector.h"
12 #include "wtf/text/WTFString.h"
19 // http://fetch.spec.whatwg.org/#terminology-headers
20 class FetchHeaderList FINAL : public GarbageCollectedFinalized<FetchHeaderList> {
22 typedef std::pair<String, String> Header;
23 static FetchHeaderList* create();
24 FetchHeaderList* createCopy();
27 void append(const String&, const String&);
28 void set(const String&, const String&);
29 // FIXME: Implement parse()
30 // FIXME: Implement extractMIMEType()
33 void remove(const String&);
34 bool get(const String&, String&) const;
35 void getAll(const String&, Vector<String>&) const;
36 bool has(const String&) const;
39 bool containsNonSimpleHeader() const;
41 const Vector<OwnPtr<Header> >& list() const { return m_headerList; }
43 static bool isValidHeaderName(const String&);
44 static bool isValidHeaderValue(const String&);
46 void trace(Visitor*) { }
50 Vector<OwnPtr<Header> > m_headerList;
55 #endif // FetchHeaderList_h