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: sof 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 DOMURLUtils;
sof 2015/11/16 10:11:53 nit: nop
17 class ExceptionState;
18
19 class CORE_EXPORT URLSearchParams final : public GarbageCollectedFinalized<URLSe archParams>, public ScriptWrappable {
20 DEFINE_WRAPPERTYPEINFO();
21
22 public:
23 // TODO(mkwst): We should support integration with URLUtils, as explored in
24 // https://codereview.chromium.org/143313002/. That approach is totally
25 // reasonable, but relies on Node switching to Oilpan. Sigbjorn assures me
26 // that this will happen Real Soon Now(tm).
27 static URLSearchParams* create(const String& queryString = String())
28 {
29 return new URLSearchParams(queryString);
30 }
31
32 static URLSearchParams* create(URLSearchParams* searchParams)
33 {
34 return new URLSearchParams(searchParams);
35 }
36
37 // TODO(mkwst): ScriptWrappable doesn't have a destructor with Oilpan, so th is
38 // won't need to be virtual once that's the default.
39 virtual ~URLSearchParams();
40
41 // URLSearchParams interface methods
42 String toString() const;
43 void append(const String& name, const String& value);
44 void deleteAllWithName(const String&);
45 String get(const String&) const;
46 Vector<String> getAll(const String&) const;
47 bool has(const String&) const;
48 void set(const String& name, const String& value);
49 void setInput(const String&);
50
51 DECLARE_TRACE();
52
53 private:
54 explicit URLSearchParams(const String&);
55 explicit URLSearchParams(URLSearchParams*);
56 Vector<std::pair<String, String>> m_params;
57 };
58
59 } // namespace blink
60
61 #endif // URLSearchParams_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698