OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef URLSearchParams_h | 5 #ifndef URLSearchParams_h |
6 #define URLSearchParams_h | 6 #define URLSearchParams_h |
7 | 7 |
8 #include "bindings/core/v8/Iterable.h" | 8 #include "bindings/core/v8/Iterable.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "bindings/core/v8/USVStringOrURLSearchParams.h" | 10 #include "bindings/core/v8/USVStringOrURLSearchParams.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 String toString() const; | 39 String toString() const; |
40 void append(const String& name, const String& value); | 40 void append(const String& name, const String& value); |
41 void deleteAllWithName(const String&); | 41 void deleteAllWithName(const String&); |
42 String get(const String&) const; | 42 String get(const String&) const; |
43 Vector<String> getAll(const String&) const; | 43 Vector<String> getAll(const String&) const; |
44 bool has(const String&) const; | 44 bool has(const String&) const; |
45 void set(const String& name, const String& value); | 45 void set(const String& name, const String& value); |
46 void setInput(const String&); | 46 void setInput(const String&); |
47 | 47 |
48 // Internal helpers | 48 // Internal helpers |
49 PassRefPtr<EncodedFormData> encodeFormData() const; | 49 PassRefPtr<EncodedFormData> toEncodedFormData() const; |
50 const Vector<std::pair<String, String>>& params() const { return m_params; } | 50 const Vector<std::pair<String, String>>& params() const { return m_params; } |
51 | 51 |
52 #if ENABLE(ASSERT) | 52 #if ENABLE(ASSERT) |
53 DOMURL* urlObject() const; | 53 DOMURL* urlObject() const; |
54 #endif | 54 #endif |
55 | 55 |
56 DECLARE_TRACE(); | 56 DECLARE_TRACE(); |
57 | 57 |
58 private: | 58 private: |
59 FRIEND_TEST_ALL_PREFIXES(URLSearchParamsTest, EncodedFormData); | 59 FRIEND_TEST_ALL_PREFIXES(URLSearchParamsTest, EncodedFormData); |
60 | 60 |
61 explicit URLSearchParams(const String&, DOMURL* = nullptr); | 61 explicit URLSearchParams(const String&, DOMURL* = nullptr); |
62 explicit URLSearchParams(URLSearchParams*); | 62 explicit URLSearchParams(URLSearchParams*); |
63 | 63 |
64 void runUpdateSteps(); | 64 void runUpdateSteps(); |
65 IterationSource* startIteration(ScriptState*, ExceptionState&) override; | 65 IterationSource* startIteration(ScriptState*, ExceptionState&) override; |
| 66 void encodeAsFormData(Vector<char>&) const; |
66 | 67 |
67 Vector<std::pair<String, String>> m_params; | 68 Vector<std::pair<String, String>> m_params; |
68 | 69 |
69 WeakMember<DOMURL> m_urlObject; | 70 WeakMember<DOMURL> m_urlObject; |
70 }; | 71 }; |
71 | 72 |
72 } // namespace blink | 73 } // namespace blink |
73 | 74 |
74 #endif // URLSearchParams_h | 75 #endif // URLSearchParams_h |
OLD | NEW |