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

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: restrict .searchParams to URL only 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
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..5f6e836543db1059118005545bcca88a287cb92c 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,25 @@ 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;
+
+ Member<DOMURL> m_urlObject;
+ bool m_isUpdating = false;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698