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

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

Issue 795323003: Move Fetch API releted code to modules/fetch. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
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 "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"
13 #include <utility>
14
15 namespace blink {
16
17 class Header;
18
19 // http://fetch.spec.whatwg.org/#terminology-headers
20 class FetchHeaderList final : public GarbageCollectedFinalized<FetchHeaderList> {
21 public:
22 typedef std::pair<String, String> Header;
23 static FetchHeaderList* create();
24 FetchHeaderList* createCopy();
25
26 ~FetchHeaderList();
27 void append(const String&, const String&);
28 void set(const String&, const String&);
29 // FIXME: Implement parse()
30 // FIXME: Implement extractMIMEType()
31
32 size_t size() const;
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;
37 void clearList();
38
39 bool containsNonSimpleHeader() const;
40
41 const Vector<OwnPtr<Header> >& list() const { return m_headerList; }
42 const Header& entry(size_t index) const { return *(m_headerList[index].get() ); }
43
44 static bool isValidHeaderName(const String&);
45 static bool isValidHeaderValue(const String&);
46
47 void trace(Visitor*) { }
48
49 private:
50 FetchHeaderList();
51 Vector<OwnPtr<Header> > m_headerList;
52 };
53
54 } // namespace blink
55
56 #endif // FetchHeaderList_h
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/FetchEvent.cpp ('k') | Source/modules/serviceworkers/FetchHeaderList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698