Index: Source/modules/serviceworkers/HeaderMap.h |
diff --git a/Source/modules/serviceworkers/HeaderMap.h b/Source/modules/serviceworkers/HeaderMap.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f9a743223a512319b8c3d21709345c4c1d0e0a87 |
--- /dev/null |
+++ b/Source/modules/serviceworkers/HeaderMap.h |
@@ -0,0 +1,44 @@ |
+// 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 HeaderMap_h |
+#define HeaderMap_h |
+ |
+#include "bindings/v8/ScriptWrappable.h" |
+#include "wtf/Forward.h" |
+#include "wtf/HashMap.h" |
+#include "wtf/RefCounted.h" |
+#include "wtf/text/StringHash.h" |
+ |
+namespace WebCore { |
+ |
+class HeaderMapForEachCallback; |
+class ScriptValue; |
+ |
+class HeaderMap FINAL : public ScriptWrappable, public RefCounted<HeaderMap> { |
+public: |
+ static PassRefPtr<HeaderMap> create(); |
+ |
+ // HeaderMap.idl implementation. |
+ unsigned long size() const; |
+ void clear(); |
+ bool remove(const String& key); |
+ String get(const String& key); |
+ bool has(const String& key); |
+ void set(const String& key, const String& value); |
+ void forEach(PassOwnPtr<HeaderMapForEachCallback>, ScriptValue&); |
+ void forEach(PassOwnPtr<HeaderMapForEachCallback>); |
+ |
+ const HashMap<String, String>& headerMap() const { return m_headers; } |
+ |
+private: |
+ HeaderMap(); |
+ void forEachInternal(PassOwnPtr<HeaderMapForEachCallback>, ScriptValue* thisArg); |
+ |
+ HashMap<String, String> m_headers; |
jsbell
2014/05/23 20:59:49
Does this maintain order? ES6's Map type has the p
kinuko
2014/05/26 05:45:13
No, and yeah the notion of MapClass ordering worri
|
+}; |
+ |
+} // namespace WebCore |
+ |
+#endif // HeaderMap_h |