Chromium Code Reviews| 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 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 FINAL : public RefCounted<FetchHeaderList> { | |
| 17 public: | 18 public: |
| 18 static PassRefPtr<StyleWillChangeData> create() { return adoptRef(new StyleW illChangeData); } | 19 typedef std::pair<String, String> Header; |
|
falken
2014/06/27 02:08:06
nit: I think by include-what-you-use rules you sho
horo
2014/06/27 04:19:10
Done.
| |
| 19 PassRefPtr<StyleWillChangeData> copy() const { return adoptRef(new StyleWill ChangeData(*this)); } | 20 static PassRefPtr<FetchHeaderList> create(); |
| 20 | 21 |
| 21 bool operator==(const StyleWillChangeData& o) const | 22 ~FetchHeaderList(); |
| 22 { | 23 void append(const String&, const String&); |
| 23 return m_properties == o.m_properties && m_contents == o.m_contents && m _scrollPosition == o.m_scrollPosition; | 24 void set(const String&, const String&); |
| 24 } | 25 // FIXME: Implement parse() |
| 26 // FIXME: Implement extractMIMEType() | |
| 25 | 27 |
| 26 bool operator!=(const StyleWillChangeData& o) const | 28 size_t size() const; |
| 27 { | 29 void remove(const String&); |
| 28 return !(*this == o); | 30 bool get(const String&, String&) const; |
| 29 } | 31 void getAll(const String&, Vector<String>&) const; |
| 32 bool has(const String&) const; | |
| 33 void clearList(); | |
| 30 | 34 |
| 31 Vector<CSSPropertyID> m_properties; | 35 const Vector<OwnPtr<Header> >& list() const { return m_headerList; } |
| 32 unsigned m_contents : 1; | 36 |
| 33 unsigned m_scrollPosition : 1; | 37 static bool isValidHeaderName(const String&); |
| 38 static bool isValidHeaderValue(const String&); | |
| 39 static bool isSimpleHeader(const String&, const String&); | |
| 40 static bool isForbiddenHeaderName(const String&); | |
| 41 static bool isForbiddenResponseHeaderName(const String&); | |
| 34 | 42 |
| 35 private: | 43 private: |
| 36 StyleWillChangeData(); | 44 FetchHeaderList(); |
| 37 StyleWillChangeData(const StyleWillChangeData&); | 45 Vector<OwnPtr<Header> > m_headerList; |
| 38 }; | 46 }; |
| 39 | 47 |
| 40 } // namespace WebCore | 48 } // namespace WebCore |
| 41 | 49 |
| 42 #endif // StyleWillChangeData_h | 50 #endif // FetchHeaderList_h |
| OLD | NEW |