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

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

Issue 143313002: Implement URLSearchParams. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adjust position of HTMLAnchorElement's update() call Created 6 years, 6 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/core/dom/DOMURLSearchParams.h
diff --git a/Source/core/dom/DOMURLSearchParams.h b/Source/core/dom/DOMURLSearchParams.h
new file mode 100644
index 0000000000000000000000000000000000000000..173e78449cda3d7f61d0f3bb8b3f73922666ef52
--- /dev/null
+++ b/Source/core/dom/DOMURLSearchParams.h
@@ -0,0 +1,66 @@
+// 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/v8/ScriptWrappable.h"
+#include "platform/heap/Handle.h"
+#include "wtf/Forward.h"
+#include "wtf/text/WTFString.h"
+#include <utility>
+
+namespace WebCore {
+
+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();
+
+ String toString() const;
+
+ void appendNameValue(const String& name, const String& value);
+ void deleteAllWithName(const String&);
+ String getFirstValue(const String&) const;
+
+ Vector<String> getAllValues(const String&) const;
+ bool hasName(const String&) const;
+ void setNameValue(const String& name, const String& value);
+
+ void setInput(const String&);
+
+ void dropURLObject(DOMURLUtils*);
+ void addURLObject(DOMURLUtils*);
+#if ASSERT_ENABLED
+ 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;
+ HeapVector<Member<DOMURLUtils> > m_urlObjects;
+ bool m_isUpdating;
+};
+
+} // namespace WebCore
+
+#endif // DOMURLSearchParams_h

Powered by Google App Engine
This is Rietveld 408576698