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

Unified Diff: Source/core/dom/DOMURLUtils.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/DOMURLSearchParams.cpp ('k') | Source/core/dom/DOMURLUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMURLUtils.h
diff --git a/Source/core/dom/DOMURLUtils.h b/Source/core/dom/DOMURLUtils.h
index 6635c15e9c1e446aa137bfe014eb38dd50effa7e..e61cade0207be55d4a3fa5549b16ca35f2541330 100644
--- a/Source/core/dom/DOMURLUtils.h
+++ b/Source/core/dom/DOMURLUtils.h
@@ -27,18 +27,33 @@
#ifndef DOMURLUtils_h
#define DOMURLUtils_h
+#include "core/dom/DOMURLSearchParams.h"
#include "core/dom/DOMURLUtilsReadOnly.h"
+#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
+#include "wtf/text/WTFString.h"
+
+// FIXME: URLSearchParams depends on Oilpan, and it being used by
+// default for Node-derived objects (for HTMLAnchorElement.)
+// To enable testing before that is the case, use an ad-hoc
+// #define to protect the parts we're unable to support without
+// Oilpan.
+#if ENABLE(OILPAN)
+#define URLUTILS_SUPPORTS_SEARCHPARAMS 1
+#else
+#define URLUTILS_SUPPORTS_SEARCHPARAMS 0
+#endif
namespace blink {
+class ExceptionState;
class KURL;
-class DOMURLUtils : public DOMURLUtilsReadOnly {
+class DOMURLUtils : public DOMURLUtilsReadOnly, public WillBeGarbageCollectedMixin {
public:
virtual void setURL(const KURL&) = 0;
virtual void setInput(const String&) = 0;
- virtual ~DOMURLUtils() { };
+ virtual ~DOMURLUtils();
void setHref(const String&);
@@ -51,6 +66,27 @@ public:
void setPathname(const String&);
void setSearch(const String&);
void setHash(const String&);
+
+ void update();
+
+ DOMURLSearchParams* searchParams();
+ void setSearchParams(DOMURLSearchParams*, ExceptionState&);
+
+ virtual void trace(Visitor*);
+
+protected:
+ friend class DOMURLSearchParams;
+
+ void createSearchParams(const String&);
+ void updateSearchParams(const String&);
+
+ void setQuery(const String&);
+
+#if URLUTILS_SUPPORTS_SEARCHPARAMS
+ // Weakly refer to the searchParams object, so that it can be
+ // GCed if otherwise unused and unreferenced.
+ WeakMember<DOMURLSearchParams> m_searchParams;
+#endif
};
} // namespace blink
« no previous file with comments | « Source/core/dom/DOMURLSearchParams.cpp ('k') | Source/core/dom/DOMURLUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698