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

Unified Diff: Source/core/dom/DOMURLSearchParams.h

Issue 143313002: Implement URLSearchParams. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 4 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/core/dom/DOMURL.cpp ('k') | Source/core/dom/DOMURLSearchParams.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMURLSearchParams.h
diff --git a/Source/core/dom/DOMURLSearchParams.h b/Source/core/dom/DOMURLSearchParams.h
new file mode 100644
index 0000000000000000000000000000000000000000..2bb8215077446e552f13992c812619f06e5cdcf5
--- /dev/null
+++ b/Source/core/dom/DOMURLSearchParams.h
@@ -0,0 +1,65 @@
+// 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 DOMURLSearchParams_h
+#define DOMURLSearchParams_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 DOMURLSearchParams FINAL : public GarbageCollectedFinalized<DOMURLSearchParams>, public ScriptWrappable {
+public:
+ static DOMURLSearchParams* create(const String& queryString = String(), DOMURLUtils* urlObject = 0)
+ {
+ return new DOMURLSearchParams(queryString, urlObject);
+ }
+
+ static DOMURLSearchParams* create(DOMURLSearchParams* searchParams, DOMURLUtils* urlObject = 0)
+ {
+ return new DOMURLSearchParams(searchParams, urlObject);
+ }
+
+ virtual ~DOMURLSearchParams();
+
+ // 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&);
+
+ void dropURLObject(DOMURLUtils*);
+ void addURLObject(DOMURLUtils*);
+#if ENABLE(ASSERT)
+ bool hasURLObject(DOMURLUtils*) const;
+#endif
+
+ void trace(Visitor*);
+
+private:
+ DOMURLSearchParams(const String&, DOMURLUtils*);
+ DOMURLSearchParams(DOMURLSearchParams*, DOMURLUtils*);
+
+ void runUpdateSteps();
+
+ Vector<std::pair<String, String> > m_params;
+ WillBeHeapVector<RawPtrWillBeMember<DOMURLUtils> > m_urlObjects;
+ bool m_isUpdating;
+};
+
+} // namespace blink
+
+#endif // DOMURLSearchParams_h
« no previous file with comments | « Source/core/dom/DOMURL.cpp ('k') | Source/core/dom/DOMURLSearchParams.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698