Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Side by Side Diff: Source/modules/serviceworkers/FetchHeaderList.h

Issue 358573002: [ServiceWorker] Implement Headers class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/serviceworkers/FetchHeaderList.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef FetchHeaderList_h
6 #define FetchHeaderList_h
7
8 #include "wtf/OwnPtr.h"
9 #include "wtf/PassRefPtr.h"
10 #include "wtf/RefCounted.h"
11 #include "wtf/Vector.h"
12 #include "wtf/text/WTFString.h"
13 #include <utility>
14
15 namespace WebCore {
16
17 // http://fetch.spec.whatwg.org/#terminology-headers
18 class FetchHeaderList FINAL : public RefCounted<FetchHeaderList> {
19 public:
20 typedef std::pair<String, String> Header;
21 static PassRefPtr<FetchHeaderList> create();
22
23 ~FetchHeaderList();
24 void append(const String&, const String&);
25 void set(const String&, const String&);
26 // FIXME: Implement parse()
27 // FIXME: Implement extractMIMEType()
28
29 size_t size() const;
30 void remove(const String&);
31 bool get(const String&, String&) const;
32 void getAll(const String&, Vector<String>&) const;
33 bool has(const String&) const;
34 void clearList();
35
36 const Vector<OwnPtr<Header> >& list() const { return m_headerList; }
37
38 static bool isValidHeaderName(const String&);
39 static bool isValidHeaderValue(const String&);
40 static bool isSimpleHeader(const String&, const String&);
41 static bool isForbiddenHeaderName(const String&);
42 static bool isForbiddenResponseHeaderName(const String&);
43
44 private:
45 FetchHeaderList();
46 Vector<OwnPtr<Header> > m_headerList;
47 };
48
49 } // namespace WebCore
50
51 #endif // FetchHeaderList_h
OLDNEW
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/serviceworkers/FetchHeaderList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698