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

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: rebase 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
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/serviceworkers/FetchHeaderList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/FetchHeaderList.h
diff --git a/Source/modules/serviceworkers/FetchHeaderList.h b/Source/modules/serviceworkers/FetchHeaderList.h
new file mode 100644
index 0000000000000000000000000000000000000000..2f7d5c61f42da9e8c0e4300bc7d0d7bde87c0a7a
--- /dev/null
+++ b/Source/modules/serviceworkers/FetchHeaderList.h
@@ -0,0 +1,51 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef FetchHeaderList_h
+#define FetchHeaderList_h
+
+#include "wtf/OwnPtr.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/Vector.h"
+#include "wtf/text/WTFString.h"
+#include <utility>
+
+namespace WebCore {
+
+// http://fetch.spec.whatwg.org/#terminology-headers
+class FetchHeaderList FINAL : public RefCounted<FetchHeaderList> {
+public:
+ typedef std::pair<String, String> Header;
+ static PassRefPtr<FetchHeaderList> create();
+
+ ~FetchHeaderList();
+ void append(const String&, const String&);
+ void set(const String&, const String&);
+ // FIXME: Implement parse()
+ // FIXME: Implement extractMIMEType()
+
+ 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();
+
+ 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:
+ FetchHeaderList();
+ Vector<OwnPtr<Header> > m_headerList;
+};
+
+} // namespace WebCore
+
+#endif // FetchHeaderList_h
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/serviceworkers/FetchHeaderList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698