Chromium Code Reviews| OLD | NEW |
|---|---|
| (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; | |
| 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 virtual ~URLSearchParams(); | |
|
sof
2015/11/15 09:04:11
Just noting -- ScriptWrappable doesn't have a dest
Mike West
2015/11/16 08:57:57
Added a comment.
| |
| 38 | |
| 39 // URLSearchParams interface methods | |
| 40 String toString() const; | |
| 41 void append(const String& name, const String& value); | |
| 42 void deleteAllWithName(const String&); | |
| 43 String get(const String&) const; | |
| 44 Vector<String> getAll(const String&) const; | |
| 45 bool has(const String&) const; | |
| 46 void set(const String& name, const String& value); | |
| 47 void setInput(const String&); | |
| 48 | |
| 49 DECLARE_TRACE(); | |
| 50 | |
| 51 private: | |
| 52 URLSearchParams(const String&); | |
|
sof
2015/11/15 09:04:11
nit: put 'explicit' on these.
Mike West
2015/11/16 08:57:57
Done.
| |
| 53 URLSearchParams(URLSearchParams*); | |
| 54 Vector<std::pair<String, String>> m_params; | |
| 55 }; | |
| 56 | |
| 57 } // namespace blink | |
| 58 | |
| 59 #endif // URLSearchParams_h | |
| OLD | NEW |