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

Unified 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698