OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 class FormDataElement { | 35 class FormDataElement { |
36 public: | 36 public: |
37 FormDataElement() : m_type(data) { } | 37 FormDataElement() : m_type(data) { } |
38 explicit FormDataElement(const Vector<char>& array) : m_type(data), m_data(a
rray) { } | 38 explicit FormDataElement(const Vector<char>& array) : m_type(data), m_data(a
rray) { } |
39 | 39 |
40 FormDataElement(const String& filename, long long fileStart, long long fileL
ength, double expectedFileModificationTime, bool shouldGenerateFile) : m_type(en
codedFile), m_filename(filename), m_fileStart(fileStart), m_fileLength(fileLengt
h), m_expectedFileModificationTime(expectedFileModificationTime), m_shouldGenera
teFile(shouldGenerateFile) { } | 40 FormDataElement(const String& filename, long long fileStart, long long fileL
ength, double expectedFileModificationTime, bool shouldGenerateFile) : m_type(en
codedFile), m_filename(filename), m_fileStart(fileStart), m_fileLength(fileLengt
h), m_expectedFileModificationTime(expectedFileModificationTime), m_shouldGenera
teFile(shouldGenerateFile) { } |
41 explicit FormDataElement(const KURL& blobURL) : m_type(encodedBlob), m_url(b
lobURL) { } | 41 explicit FormDataElement(const KURL& blobURL) : m_type(encodedBlob), m_url(b
lobURL) { } |
42 FormDataElement(const KURL& url, long long start, long long length, double e
xpectedFileModificationTime) : m_type(encodedURL), m_url(url), m_fileStart(start
), m_fileLength(length), m_expectedFileModificationTime(expectedFileModification
Time), m_shouldGenerateFile(false) { } | 42 FormDataElement(const KURL& url, long long start, long long length, double e
xpectedFileModificationTime) : m_type(encodedURL), m_url(url), m_fileStart(start
), m_fileLength(length), m_expectedFileModificationTime(expectedFileModification
Time), m_shouldGenerateFile(false) { } |
43 | 43 |
44 void reportMemoryUsage(MemoryObjectInfo*) const; | |
45 | |
46 enum Type { | 44 enum Type { |
47 data, | 45 data, |
48 encodedFile | 46 encodedFile |
49 , encodedBlob | 47 , encodedBlob |
50 , encodedURL | 48 , encodedURL |
51 } m_type; | 49 } m_type; |
52 Vector<char> m_data; | 50 Vector<char> m_data; |
53 String m_filename; | 51 String m_filename; |
54 KURL m_url; // For Blob or URL. | 52 KURL m_url; // For Blob or URL. |
55 long long m_fileStart; | 53 long long m_fileStart; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 void setAlwaysStream(bool alwaysStream) { m_alwaysStream = alwaysStream; } | 123 void setAlwaysStream(bool alwaysStream) { m_alwaysStream = alwaysStream; } |
126 | 124 |
127 // Identifies a particular form submission instance. A value of 0 is used | 125 // Identifies a particular form submission instance. A value of 0 is used |
128 // to indicate an unspecified identifier. | 126 // to indicate an unspecified identifier. |
129 void setIdentifier(int64_t identifier) { m_identifier = identifier; } | 127 void setIdentifier(int64_t identifier) { m_identifier = identifier; } |
130 int64_t identifier() const { return m_identifier; } | 128 int64_t identifier() const { return m_identifier; } |
131 | 129 |
132 bool containsPasswordData() const { return m_containsPasswordData; } | 130 bool containsPasswordData() const { return m_containsPasswordData; } |
133 void setContainsPasswordData(bool containsPasswordData) { m_containsPassword
Data = containsPasswordData; } | 131 void setContainsPasswordData(bool containsPasswordData) { m_containsPassword
Data = containsPasswordData; } |
134 | 132 |
135 void reportMemoryUsage(MemoryObjectInfo*) const; | |
136 | |
137 static EncodingType parseEncodingType(const String& type) | 133 static EncodingType parseEncodingType(const String& type) |
138 { | 134 { |
139 if (equalIgnoringCase(type, "text/plain")) | 135 if (equalIgnoringCase(type, "text/plain")) |
140 return TextPlain; | 136 return TextPlain; |
141 if (equalIgnoringCase(type, "multipart/form-data")) | 137 if (equalIgnoringCase(type, "multipart/form-data")) |
142 return MultipartFormData; | 138 return MultipartFormData; |
143 return FormURLEncoded; | 139 return FormURLEncoded; |
144 } | 140 } |
145 | 141 |
146 private: | 142 private: |
(...skipping 17 matching lines...) Expand all Loading... |
164 } | 160 } |
165 | 161 |
166 inline bool operator!=(const FormData& a, const FormData& b) | 162 inline bool operator!=(const FormData& a, const FormData& b) |
167 { | 163 { |
168 return !(a == b); | 164 return !(a == b); |
169 } | 165 } |
170 | 166 |
171 } // namespace WebCore | 167 } // namespace WebCore |
172 | 168 |
173 #endif | 169 #endif |
OLD | NEW |