| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 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 10 matching lines...) Expand all Loading... |
| 21 #include "config.h" | 21 #include "config.h" |
| 22 #include "core/html/FormDataList.h" | 22 #include "core/html/FormDataList.h" |
| 23 | 23 |
| 24 #include "core/fileapi/File.h" | 24 #include "core/fileapi/File.h" |
| 25 #include "platform/network/FormDataBuilder.h" | 25 #include "platform/network/FormDataBuilder.h" |
| 26 #include "platform/text/LineEnding.h" | 26 #include "platform/text/LineEnding.h" |
| 27 #include "wtf/CurrentTime.h" | 27 #include "wtf/CurrentTime.h" |
| 28 | 28 |
| 29 namespace blink { | 29 namespace blink { |
| 30 | 30 |
| 31 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(FormDataList); | |
| 32 | |
| 33 FormDataList::FormDataList(const WTF::TextEncoding& c) | 31 FormDataList::FormDataList(const WTF::TextEncoding& c) |
| 34 : m_encoding(c) | 32 : m_encoding(c) |
| 35 { | 33 { |
| 36 } | 34 } |
| 37 | 35 |
| 38 void FormDataList::appendString(const String& string) | 36 void FormDataList::appendString(const String& string) |
| 39 { | 37 { |
| 40 m_items.append(encodeAndNormalize(string)); | 38 m_items.append(encodeAndNormalize(string)); |
| 41 } | 39 } |
| 42 | 40 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 const FormDataListItems& items = this->items(); | 85 const FormDataListItems& items = this->items(); |
| 88 size_t formDataListSize = items.size(); | 86 size_t formDataListSize = items.size(); |
| 89 ASSERT(!(formDataListSize % 2)); | 87 ASSERT(!(formDataListSize % 2)); |
| 90 if (index >= formDataListSize / 2) | 88 if (index >= formDataListSize / 2) |
| 91 return Entry(); | 89 return Entry(); |
| 92 const FormDataList::Item& key = items[index * 2]; | 90 const FormDataList::Item& key = items[index * 2]; |
| 93 const FormDataList::Item& value = items[index * 2 + 1]; | 91 const FormDataList::Item& value = items[index * 2 + 1]; |
| 94 return itemsToEntry(key, value); | 92 return itemsToEntry(key, value); |
| 95 } | 93 } |
| 96 | 94 |
| 97 WillBeHeapVector<FormDataList::Entry> FormDataList::getAll(const String& key) co
nst | 95 HeapVector<FormDataList::Entry> FormDataList::getAll(const String& key) const |
| 98 { | 96 { |
| 99 WillBeHeapVector<FormDataList::Entry> matches; | 97 HeapVector<FormDataList::Entry> matches; |
| 100 | 98 |
| 101 const CString keyData = encodeAndNormalize(key); | 99 const CString keyData = encodeAndNormalize(key); |
| 102 const FormDataListItems& items = this->items(); | 100 const FormDataListItems& items = this->items(); |
| 103 size_t formDataListSize = items.size(); | 101 size_t formDataListSize = items.size(); |
| 104 ASSERT(!(formDataListSize % 2)); | 102 ASSERT(!(formDataListSize % 2)); |
| 105 for (size_t i = 0; i < formDataListSize; i += 2) { | 103 for (size_t i = 0; i < formDataListSize; i += 2) { |
| 106 const FormDataList::Item& key = items[i]; | 104 const FormDataList::Item& key = items[i]; |
| 107 if (key.data() != keyData) | 105 if (key.data() != keyData) |
| 108 continue; | 106 continue; |
| 109 const FormDataList::Item& value = items[i + 1]; | 107 const FormDataList::Item& value = items[i + 1]; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 { | 296 { |
| 299 visitor->trace(m_file); | 297 visitor->trace(m_file); |
| 300 } | 298 } |
| 301 | 299 |
| 302 DEFINE_TRACE(FormDataList::Item) | 300 DEFINE_TRACE(FormDataList::Item) |
| 303 { | 301 { |
| 304 visitor->trace(m_blob); | 302 visitor->trace(m_blob); |
| 305 } | 303 } |
| 306 | 304 |
| 307 } // namespace blink | 305 } // namespace blink |
| OLD | NEW |