Index: third_party/WebKit/Source/core/dom/URLSearchParams.h |
diff --git a/third_party/WebKit/Source/core/dom/URLSearchParams.h b/third_party/WebKit/Source/core/dom/URLSearchParams.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8605d275c94b755532bd4d18ef63b9640ed21858 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/dom/URLSearchParams.h |
@@ -0,0 +1,59 @@ |
+// Copyright 2015 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 URLSearchParams_h |
+#define URLSearchParams_h |
+ |
+#include "bindings/core/v8/ScriptWrappable.h" |
+#include "platform/heap/Handle.h" |
+#include "wtf/Forward.h" |
+#include "wtf/text/WTFString.h" |
+#include <utility> |
+ |
+namespace blink { |
+ |
+class DOMURLUtils; |
+class ExceptionState; |
+ |
+class CORE_EXPORT URLSearchParams final : public GarbageCollectedFinalized<URLSearchParams>, public ScriptWrappable { |
+ DEFINE_WRAPPERTYPEINFO(); |
+ |
+public: |
+ // TODO(mkwst): We should support integration with URLUtils, as explored in |
+ // https://codereview.chromium.org/143313002/. That approach is totally |
+ // reasonable, but relies on Node switching to Oilpan. Sigbjorn assures me |
+ // that this will happen Real Soon Now(tm). |
+ static URLSearchParams* create(const String& queryString = String()) |
+ { |
+ return new URLSearchParams(queryString); |
+ } |
+ |
+ static URLSearchParams* create(URLSearchParams* searchParams) |
+ { |
+ return new URLSearchParams(searchParams); |
+ } |
+ |
+ virtual ~URLSearchParams(); |
sof
2015/11/15 09:04:11
Just noting -- ScriptWrappable doesn't have a dest
Mike West
2015/11/16 08:57:57
Added a comment.
|
+ |
+ // URLSearchParams interface methods |
+ String toString() const; |
+ void append(const String& name, const String& value); |
+ void deleteAllWithName(const String&); |
+ String get(const String&) const; |
+ Vector<String> getAll(const String&) const; |
+ bool has(const String&) const; |
+ void set(const String& name, const String& value); |
+ void setInput(const String&); |
+ |
+ DECLARE_TRACE(); |
+ |
+private: |
+ URLSearchParams(const String&); |
sof
2015/11/15 09:04:11
nit: put 'explicit' on these.
Mike West
2015/11/16 08:57:57
Done.
|
+ URLSearchParams(URLSearchParams*); |
+ Vector<std::pair<String, String>> m_params; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // URLSearchParams_h |