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

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

Issue 1860623002: Add support for URL.searchParams getter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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 | « third_party/WebKit/Source/core/dom/URL.idl ('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
index 59c797472d2a9929aff90c26c77c0074ddb8ff0d..5b2b44631aea685b88e2237be0c97b8b90cd1b45 100644
--- a/third_party/WebKit/Source/core/dom/URLSearchParams.h
+++ b/third_party/WebKit/Source/core/dom/URLSearchParams.h
@@ -18,6 +18,7 @@
namespace blink {
class ExceptionState;
+class DOMURL;
typedef USVStringOrURLSearchParams URLSearchParamsInit;
@@ -25,15 +26,14 @@ class CORE_EXPORT URLSearchParams final : public GarbageCollectedFinalized<URLSe
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();
+ static URLSearchParams* create(const String& queryString, DOMURL* urlObject = nullptr)
+ {
+ return new URLSearchParams(queryString, urlObject);
+ }
+
+ ~URLSearchParams();
// URLSearchParams interface methods
String toString() const;
@@ -49,16 +49,24 @@ public:
PassRefPtr<EncodedFormData> encodeFormData() const;
const Vector<std::pair<String, String>>& params() const { return m_params; }
+#if ENABLE(ASSERT)
+ DOMURL* urlObject() const;
+#endif
+
DECLARE_TRACE();
private:
FRIEND_TEST_ALL_PREFIXES(URLSearchParamsTest, EncodedFormData);
- explicit URLSearchParams(const String&);
+ explicit URLSearchParams(const String&, DOMURL* = nullptr);
explicit URLSearchParams(URLSearchParams*);
- Vector<std::pair<String, String>> m_params;
+ void runUpdateSteps();
IterationSource* startIteration(ScriptState*, ExceptionState&) override;
+
+ Vector<std::pair<String, String>> m_params;
+
+ WeakMember<DOMURL> m_urlObject;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/URL.idl ('k') | third_party/WebKit/Source/core/dom/URLSearchParams.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698