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

Unified Diff: third_party/WebKit/Source/core/dom/URLSearchParams.h

Issue 1442643008: Implement 'URLSearchParams' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test. Created 5 years, 1 month 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 | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/dom/URLSearchParams.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7eb3dfbe3d4f20f44d7b60e0710333ac5a47cb03
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/URLSearchParams.h
@@ -0,0 +1,58 @@
+// 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/Iterable.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "bindings/core/v8/UnionTypesCore.h"
+#include "platform/heap/Handle.h"
+#include "wtf/Forward.h"
+#include "wtf/text/WTFString.h"
+#include <utility>
+
+namespace blink {
+
+class ExceptionState;
+
+typedef USVStringOrURLSearchParams URLSearchParamsInit;
+
+class CORE_EXPORT URLSearchParams final : public GarbageCollectedFinalized<URLSearchParams>, public ScriptWrappable, public PairIterable<String, String> {
+ 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 URLSearchParamsInit&);
+
+ // TODO(mkwst): ScriptWrappable doesn't have a destructor with Oilpan, so this
+ // won't need to be virtual once that's the default.
+ virtual ~URLSearchParams();
+
+ // 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:
+ explicit URLSearchParams(const String&);
+ explicit URLSearchParams(URLSearchParams*);
+ Vector<std::pair<String, String>> m_params;
+
+ IterationSource* startIteration(ScriptState*, ExceptionState&) override;
+};
+
+} // namespace blink
+
+#endif // URLSearchParams_h
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/dom/URLSearchParams.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698