| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008, 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, 2012 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 { | 117 { |
| 118 for (size_t i = 0; i < m_itemList.size(); ++i) { | 118 for (size_t i = 0; i < m_itemList.size(); ++i) { |
| 119 if (m_itemList[i]->kind() == DataObjectItem::StringKind && m_itemList[i]
->type() == type) { | 119 if (m_itemList[i]->kind() == DataObjectItem::StringKind && m_itemList[i]
->type() == type) { |
| 120 // Per the spec, type must be unique among all items of kind 'string
'. | 120 // Per the spec, type must be unique among all items of kind 'string
'. |
| 121 m_itemList.remove(i); | 121 m_itemList.remove(i); |
| 122 return; | 122 return; |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 void DataObject::clearAllExceptFiles() | |
| 128 { | |
| 129 for (size_t i = 0; i < m_itemList.size(); ) { | |
| 130 if (m_itemList[i]->kind() != DataObjectItem::FileKind) { | |
| 131 m_itemList.remove(i); | |
| 132 continue; | |
| 133 } | |
| 134 ++i; | |
| 135 } | |
| 136 } | |
| 137 | |
| 138 ListHashSet<String> DataObject::types() const | 127 ListHashSet<String> DataObject::types() const |
| 139 { | 128 { |
| 140 ListHashSet<String> results; | 129 ListHashSet<String> results; |
| 141 bool containsFiles = false; | 130 bool containsFiles = false; |
| 142 for (size_t i = 0; i < m_itemList.size(); ++i) { | 131 for (size_t i = 0; i < m_itemList.size(); ++i) { |
| 143 switch (m_itemList[i]->kind()) { | 132 switch (m_itemList[i]->kind()) { |
| 144 case DataObjectItem::StringKind: | 133 case DataObjectItem::StringKind: |
| 145 results.add(m_itemList[i]->type()); | 134 results.add(m_itemList[i]->type()); |
| 146 break; | 135 break; |
| 147 case DataObjectItem::FileKind: | 136 case DataObjectItem::FileKind: |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 m_itemList.append(item); | 258 m_itemList.append(item); |
| 270 } | 259 } |
| 271 | 260 |
| 272 void DataObject::trace(Visitor* visitor) | 261 void DataObject::trace(Visitor* visitor) |
| 273 { | 262 { |
| 274 visitor->trace(m_itemList); | 263 visitor->trace(m_itemList); |
| 275 WillBeHeapSupplementable<DataObject>::trace(visitor); | 264 WillBeHeapSupplementable<DataObject>::trace(visitor); |
| 276 } | 265 } |
| 277 | 266 |
| 278 } // namespace WebCore | 267 } // namespace WebCore |
| OLD | NEW |