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

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

Issue 143313002: Implement URLSearchParams. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Handle dependency between URLUtils interfaces and URLSearchParams Created 6 years, 11 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/DOMURLUtils.h
diff --git a/Source/core/dom/DOMURLUtils.h b/Source/core/dom/DOMURLUtils.h
index 1987ecd72054e349d44a522bd9b4a50143f0e906..e1d2670bf1ac4174fc528c833b4e65ebedbb37a0 100644
--- a/Source/core/dom/DOMURLUtils.h
+++ b/Source/core/dom/DOMURLUtils.h
@@ -27,8 +27,10 @@
#ifndef DOMURLUtils_h
#define DOMURLUtils_h
+#include "core/dom/DOMURLSearchParams.h"
#include "core/dom/DOMURLUtilsReadOnly.h"
#include "wtf/Forward.h"
+#include "wtf/RefPtr.h"
Inactive 2014/01/21 15:25:58 You're using an OwnPtr, not a RefPtr.
#include "wtf/text/WTFString.h"
namespace WebCore {
@@ -52,6 +54,38 @@ public:
static void setPathname(DOMURLUtils*, const String&);
static void setSearch(DOMURLUtils*, const String&);
static void setHash(DOMURLUtils*, const String&);
+
+ static DOMURLSearchParams* searchParams(DOMURLUtils*, bool&);
+ static void setSearchParams(DOMURLUtils*, const String&);
+ static void setSearchParams(DOMURLUtils*, DOMURLSearchParams*);
+
+ static void update(DOMURLUtils*);
+
+ // To correctly record object dependencies during GCs, we have to
+ // map from a URLSearchParams' url object (a DOMURLUtils pointer)
+ // to its corresponding wrapper object - the wrapper object for
+ // the concrete type implementing the URLUtils interface.
+ //
+ // Indirectly (and pragmatically) express such type discovery via
+ // an enum. If the URLUtils interface is implemented by another
+ // object, and it doesn't fit with one of the below, the type will
+ // have to be extended. (Along with the custom wrapper function
+ // that considers its value.)
+ enum ImplementedBy {
+ Anchor, // derives from HTMLAnchorElement
+ DomURL
+ };
+
+ virtual ImplementedBy implementedBy() const = 0;
+
+protected:
+ static void createSearchParams(DOMURLUtils*, const String&);
+
+ friend class DOMURLSearchParams;
+ virtual void refURLUtils() = 0;
+ virtual void derefURLUtils() = 0;
+
+ OwnPtr<DOMURLSearchParams> m_searchParams;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698