Chromium Code Reviews| Index: Source/modules/serviceworkers/FetchHeaderList.h |
| diff --git a/Source/core/rendering/style/StyleWillChangeData.h b/Source/modules/serviceworkers/FetchHeaderList.h |
| similarity index 20% |
| copy from Source/core/rendering/style/StyleWillChangeData.h |
| copy to Source/modules/serviceworkers/FetchHeaderList.h |
| index 9a9b6e7621224b978eaa5ff7340fbc10f8fdc4cb..5ad2b530d6c473c907be8de4265bb655bdc96e61 100644 |
| --- a/Source/core/rendering/style/StyleWillChangeData.h |
| +++ b/Source/modules/serviceworkers/FetchHeaderList.h |
| @@ -2,41 +2,52 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef StyleWillChangeData_h |
| -#define StyleWillChangeData_h |
| +#ifndef FetchHeaderList_h |
| +#define FetchHeaderList_h |
| -#include "core/CSSPropertyNames.h" |
| -#include "core/CSSValueKeywords.h" |
| +#include "wtf/OwnPtr.h" |
| #include "wtf/PassRefPtr.h" |
| #include "wtf/RefCounted.h" |
| #include "wtf/Vector.h" |
| +#include "wtf/text/WTFString.h" |
| namespace WebCore { |
| -class StyleWillChangeData : public RefCounted<StyleWillChangeData> { |
| +// http://fetch.spec.whatwg.org/#terminology-headers |
| +class FetchHeaderList : public RefCounted<FetchHeaderList> { |
|
yhirano
2014/06/26 07:22:12
FINAL?
horo
2014/06/26 08:30:08
Done.
|
| public: |
| - static PassRefPtr<StyleWillChangeData> create() { return adoptRef(new StyleWillChangeData); } |
| - PassRefPtr<StyleWillChangeData> copy() const { return adoptRef(new StyleWillChangeData(*this)); } |
| + typedef std::pair<String, String> Header; |
| + static PassRefPtr<FetchHeaderList> create(); |
| + PassRefPtr<FetchHeaderList> createCopy(); |
|
yhirano
2014/06/26 07:22:12
This function is never called.
horo
2014/06/26 08:30:08
removed.
|
| - bool operator==(const StyleWillChangeData& o) const |
| - { |
| - return m_properties == o.m_properties && m_contents == o.m_contents && m_scrollPosition == o.m_scrollPosition; |
| - } |
| + ~FetchHeaderList(); |
| + void append(const String&, const String&); |
| + void set(const String&, const String&); |
| + // FIXME: Implement parse() |
| + // FIXME: Implement extractMIMEType() |
| - bool operator!=(const StyleWillChangeData& o) const |
| - { |
| - return !(*this == o); |
| - } |
| + size_t size() const; |
| + void remove(const String&); |
| + bool get(const String&, String&) const; |
| + void getAll(const String&, Vector<String>&) const; |
| + bool has(const String&) const; |
| + void clearList(); |
| - Vector<CSSPropertyID> m_properties; |
| - unsigned m_contents : 1; |
| - unsigned m_scrollPosition : 1; |
| + bool containsNonSimpleHeader() const; |
|
yhirano
2014/06/26 07:22:12
This function is never called.
horo
2014/06/26 08:30:08
done.removed.
|
| + |
| + const Vector<OwnPtr<Header> >& list() const { return m_headerList; } |
| + |
| + static bool isValidHeaderName(const String&); |
| + static bool isValidHeaderValue(const String&); |
| + static bool isSimpleHeader(const String&, const String&); |
| + static bool isForbiddenHeaderName(const String&); |
| + static bool isForbiddenResponseHeaderName(const String&); |
| private: |
| - StyleWillChangeData(); |
| - StyleWillChangeData(const StyleWillChangeData&); |
| + FetchHeaderList(); |
| + 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
|
| }; |
| } // namespace WebCore |
| -#endif // StyleWillChangeData_h |
| +#endif // FetchHeaderList_h |