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

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: Created 6 years, 6 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
OLDNEW
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 StyleWillChangeData_h 5 #ifndef FetchHeaderList_h
6 #define StyleWillChangeData_h 6 #define FetchHeaderList_h
7 7
8 #include "core/CSSPropertyNames.h" 8 #include "wtf/OwnPtr.h"
9 #include "core/CSSValueKeywords.h"
10 #include "wtf/PassRefPtr.h" 9 #include "wtf/PassRefPtr.h"
11 #include "wtf/RefCounted.h" 10 #include "wtf/RefCounted.h"
12 #include "wtf/Vector.h" 11 #include "wtf/Vector.h"
12 #include "wtf/text/WTFString.h"
13 13
14 namespace WebCore { 14 namespace WebCore {
15 15
16 class StyleWillChangeData : public RefCounted<StyleWillChangeData> { 16 // http://fetch.spec.whatwg.org/#terminology-headers
17 class FetchHeaderList : public RefCounted<FetchHeaderList> {
yhirano 2014/06/26 07:22:12 FINAL?
horo 2014/06/26 08:30:08 Done.
17 public: 18 public:
18 static PassRefPtr<StyleWillChangeData> create() { return adoptRef(new StyleW illChangeData); } 19 typedef std::pair<String, String> Header;
19 PassRefPtr<StyleWillChangeData> copy() const { return adoptRef(new StyleWill ChangeData(*this)); } 20 static PassRefPtr<FetchHeaderList> create();
21 PassRefPtr<FetchHeaderList> createCopy();
yhirano 2014/06/26 07:22:12 This function is never called.
horo 2014/06/26 08:30:08 removed.
20 22
21 bool operator==(const StyleWillChangeData& o) const 23 ~FetchHeaderList();
22 { 24 void append(const String&, const String&);
23 return m_properties == o.m_properties && m_contents == o.m_contents && m _scrollPosition == o.m_scrollPosition; 25 void set(const String&, const String&);
24 } 26 // FIXME: Implement parse()
27 // FIXME: Implement extractMIMEType()
25 28
26 bool operator!=(const StyleWillChangeData& o) const 29 size_t size() const;
27 { 30 void remove(const String&);
28 return !(*this == o); 31 bool get(const String&, String&) const;
29 } 32 void getAll(const String&, Vector<String>&) const;
33 bool has(const String&) const;
34 void clearList();
30 35
31 Vector<CSSPropertyID> m_properties; 36 bool containsNonSimpleHeader() const;
yhirano 2014/06/26 07:22:12 This function is never called.
horo 2014/06/26 08:30:08 done.removed.
32 unsigned m_contents : 1; 37
33 unsigned m_scrollPosition : 1; 38 const Vector<OwnPtr<Header> >& list() const { return m_headerList; }
39
40 static bool isValidHeaderName(const String&);
41 static bool isValidHeaderValue(const String&);
42 static bool isSimpleHeader(const String&, const String&);
43 static bool isForbiddenHeaderName(const String&);
44 static bool isForbiddenResponseHeaderName(const String&);
34 45
35 private: 46 private:
36 StyleWillChangeData(); 47 FetchHeaderList();
37 StyleWillChangeData(const StyleWillChangeData&); 48 Vector<OwnPtr<Header> > m_headerList;
yhirano 2014/06/26 07:22:12 Can you tell me why you use OwnPtr here?
horo 2014/06/26 08:30:08 I wanted to reduce the cost of reallocating the ex
38 }; 49 };
39 50
40 } // namespace WebCore 51 } // namespace WebCore
41 52
42 #endif // StyleWillChangeData_h 53 #endif // FetchHeaderList_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698