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

Side by Side Diff: third_party/WebKit/Source/core/dom/URLSearchParams.h

Issue 1442643008: Implement 'URLSearchParams' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef URLSearchParams_h
6 #define URLSearchParams_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "platform/heap/Handle.h"
10 #include "wtf/Forward.h"
11 #include "wtf/text/WTFString.h"
12 #include <utility>
13
14 namespace blink {
15
16 class ExceptionState;
17
18 class CORE_EXPORT URLSearchParams final : public GarbageCollectedFinalized<URLSe archParams>, public ScriptWrappable {
19 DEFINE_WRAPPERTYPEINFO();
20
21 public:
22 // TODO(mkwst): We should support integration with URLUtils, as explored in
23 // https://codereview.chromium.org/143313002/. That approach is totally
24 // reasonable, but relies on Node switching to Oilpan. Sigbjorn assures me
25 // that this will happen Real Soon Now(tm).
26 static URLSearchParams* create(const String& queryString = String())
27 {
28 return new URLSearchParams(queryString);
29 }
30
31 static URLSearchParams* create(URLSearchParams* searchParams)
32 {
33 return new URLSearchParams(searchParams);
34 }
35
36 // TODO(mkwst): ScriptWrappable doesn't have a destructor with Oilpan, so th is
37 // won't need to be virtual once that's the default.
38 virtual ~URLSearchParams();
39
40 // URLSearchParams interface methods
41 String toString() const;
42 void append(const String& name, const String& value);
43 void deleteAllWithName(const String&);
44 String get(const String&) const;
45 Vector<String> getAll(const String&) const;
46 bool has(const String&) const;
47 void set(const String& name, const String& value);
48 void setInput(const String&);
49
50 DECLARE_TRACE();
51
52 private:
53 explicit URLSearchParams(const String&);
54 explicit URLSearchParams(URLSearchParams*);
55 Vector<std::pair<String, String>> m_params;
56 };
57
58 } // namespace blink
59
60 #endif // URLSearchParams_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698