| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 IterationSource* startIteration(ScriptState*, ExceptionState&) override; | 94 IterationSource* startIteration(ScriptState*, ExceptionState&) override; |
| 95 | 95 |
| 96 WTF::TextEncoding m_encoding; | 96 WTF::TextEncoding m_encoding; |
| 97 // Entry pointers in m_entries never be nullptr. | 97 // Entry pointers in m_entries never be nullptr. |
| 98 HeapVector<Member<const Entry>> m_entries; | 98 HeapVector<Member<const Entry>> m_entries; |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 // Represents entry, which is a pair of a name and a value. | 101 // Represents entry, which is a pair of a name and a value. |
| 102 // https://xhr.spec.whatwg.org/#concept-formdata-entry | 102 // https://xhr.spec.whatwg.org/#concept-formdata-entry |
| 103 // Entry objects are immutable. | 103 // Entry objects are immutable. |
| 104 class CORE_EXPORT FormData::Entry : public GarbageCollectedFinalized<FormData::E
ntry> { | 104 class FormData::Entry : public GarbageCollectedFinalized<FormData::Entry> { |
| 105 public: | 105 public: |
| 106 Entry(const CString&, const CString&); | 106 Entry(const CString& name, const CString& value) : m_name(name), m_value(val
ue) { } |
| 107 Entry(const CString&, Blob*, const String&); | 107 Entry(const CString& name, Blob* blob, const String& filename) : m_name(name
), m_blob(blob), m_filename(filename) { } |
| 108 DECLARE_TRACE(); | 108 DECLARE_TRACE(); |
| 109 | 109 |
| 110 bool isString() const; | 110 bool isString() const { return !m_blob; } |
| 111 bool isFile() const; | 111 bool isFile() const { return m_blob; } |
| 112 const CString& name() const { return m_name; } | 112 const CString& name() const { return m_name; } |
| 113 const CString& value() const { return m_value; } | 113 const CString& value() const { return m_value; } |
| 114 Blob* blob() const; | 114 Blob* blob() const { return m_blob.get(); } |
| 115 File* file() const; | 115 File* file() const; |
| 116 const String& filename() const { return m_filename; } | 116 const String& filename() const { return m_filename; } |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 const CString m_name; | 119 const CString m_name; |
| 120 const CString m_value; | 120 const CString m_value; |
| 121 const Member<Blob> m_blob; | 121 const Member<Blob> m_blob; |
| 122 const String m_filename; | 122 const String m_filename; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace blink | 125 } // namespace blink |
| 126 | 126 |
| 127 #endif // FormData_h | 127 #endif // FormData_h |
| OLD | NEW |