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

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: Ugh. 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/Iterable.h"
9 #include "bindings/core/v8/ScriptWrappable.h"
10 #include "bindings/core/v8/UnionTypesCore.h"
11 #include "platform/heap/Handle.h"
12 #include "wtf/Forward.h"
13 #include "wtf/text/WTFString.h"
14 #include <utility>
15
16 namespace blink {
17
18 class ExceptionState;
19
20 typedef USVStringOrURLSearchParams URLSearchParamsInit;
21
22 class CORE_EXPORT URLSearchParams final : public GarbageCollectedFinalized<URLSe archParams>, public ScriptWrappable, public PairIterable<String, String> {
23 DEFINE_WRAPPERTYPEINFO();
24
25 public:
26 // TODO(mkwst): We should support integration with URLUtils, as explored in
27 // https://codereview.chromium.org/143313002/. That approach is totally
28 // reasonable, but relies on Node switching to Oilpan. Sigbjorn assures me
29 // that this will happen Real Soon Now(tm).
30 static URLSearchParams* create(const URLSearchParamsInit&);
31
32 // TODO(mkwst): ScriptWrappable doesn't have a destructor with Oilpan, so th is
33 // won't need to be virtual once that's the default.
34 virtual ~URLSearchParams();
35
36 // URLSearchParams interface methods
37 String toString() const;
38 void append(const String& name, const String& value);
39 void deleteAllWithName(const String&);
40 String get(const String&) const;
41 Vector<String> getAll(const String&) const;
42 bool has(const String&) const;
43 void set(const String& name, const String& value);
44 void setInput(const String&);
45
46 DECLARE_TRACE();
47
48 private:
49 explicit URLSearchParams(const String&);
50 explicit URLSearchParams(URLSearchParams*);
51 Vector<std::pair<String, String>> m_params;
52
53 IterationSource* startIteration(ScriptState*, ExceptionState&) override;
54 };
55
56 } // namespace blink
57
58 #endif // URLSearchParams_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698