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

Unified Diff: Source/modules/serviceworkers/HeaderMap.h

Issue 287363004: ServiceWorker: support Response.{status,statusText,headers} [blink] (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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/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

Powered by Google App Engine
This is Rietveld 408576698