OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010, 2011, 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2010, 2011, 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
214 return nullptr; | 214 return nullptr; |
215 OwnPtr<SavedFormState> savedFormState = adoptPtr(new SavedFormState); | 215 OwnPtr<SavedFormState> savedFormState = adoptPtr(new SavedFormState); |
216 while (itemCount--) { | 216 while (itemCount--) { |
217 if (index + 1 >= stateVector.size()) | 217 if (index + 1 >= stateVector.size()) |
218 return nullptr; | 218 return nullptr; |
219 String name = stateVector[index++]; | 219 String name = stateVector[index++]; |
220 String type = stateVector[index++]; | 220 String type = stateVector[index++]; |
221 FormControlState state = FormControlState::deserialize(stateVector, inde x); | 221 FormControlState state = FormControlState::deserialize(stateVector, inde x); |
222 if (type.isEmpty() || type.find(isNotFormControlTypeCharacter) != kNotFo und || state.isFailure()) | 222 if (type.isEmpty() || type.find(isNotFormControlTypeCharacter) != kNotFo und || state.isFailure()) |
223 return nullptr; | 223 return nullptr; |
224 savedFormState->appendControlState(name, type, state); | 224 savedFormState->appendControlState(AtomicString(name), AtomicString(type ), state); |
225 } | 225 } |
226 return savedFormState.release(); | 226 return savedFormState.release(); |
227 } | 227 } |
228 | 228 |
229 void SavedFormState::serializeTo(Vector<String>& stateVector) const | 229 void SavedFormState::serializeTo(Vector<String>& stateVector) const |
230 { | 230 { |
231 stateVector.append(String::number(m_controlStateCount)); | 231 stateVector.append(String::number(m_controlStateCount)); |
232 for (FormElementStateMap::const_iterator it = m_stateForNewFormElements.begi n(); it != m_stateForNewFormElements.end(); ++it) { | 232 for (FormElementStateMap::const_iterator it = m_stateForNewFormElements.begi n(); it != m_stateForNewFormElements.end(); ++it) { |
233 const FormElementKey& key = it->key; | 233 const FormElementKey& key = it->key; |
234 const Deque<FormControlState>& queue = it->value; | 234 const Deque<FormControlState>& queue = it->value; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
446 | 446 |
447 void FormController::formStatesFromStateVector(const Vector<String>& stateVector , SavedFormStateMap& map) | 447 void FormController::formStatesFromStateVector(const Vector<String>& stateVector , SavedFormStateMap& map) |
448 { | 448 { |
449 map.clear(); | 449 map.clear(); |
450 | 450 |
451 size_t i = 0; | 451 size_t i = 0; |
452 if (stateVector.size() < 1 || stateVector[i++] != formStateSignature()) | 452 if (stateVector.size() < 1 || stateVector[i++] != formStateSignature()) |
453 return; | 453 return; |
454 | 454 |
455 while (i + 1 < stateVector.size()) { | 455 while (i + 1 < stateVector.size()) { |
456 AtomicString formKey = stateVector[i++]; | 456 AtomicString formKey = AtomicString(stateVector[i++]); |
eseidel
2013/12/31 23:22:35
I guess the stateVector should eventually be Vecto
Inactive
2014/01/01 19:26:29
I took a look at it and it looks like this change
| |
457 OwnPtr<SavedFormState> state = SavedFormState::deserialize(stateVector, i); | 457 OwnPtr<SavedFormState> state = SavedFormState::deserialize(stateVector, i); |
458 if (!state) { | 458 if (!state) { |
459 i = 0; | 459 i = 0; |
460 break; | 460 break; |
461 } | 461 } |
462 map.add(formKey, state.release()); | 462 map.add(formKey, state.release()); |
463 } | 463 } |
464 if (i != stateVector.size()) | 464 if (i != stateVector.size()) |
465 map.clear(); | 465 map.clear(); |
466 } | 466 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
518 m_formElementsWithState.add(control); | 518 m_formElementsWithState.add(control); |
519 } | 519 } |
520 | 520 |
521 void FormController::unregisterFormElementWithState(HTMLFormControlElementWithSt ate* control) | 521 void FormController::unregisterFormElementWithState(HTMLFormControlElementWithSt ate* control) |
522 { | 522 { |
523 RELEASE_ASSERT(m_formElementsWithState.contains(control)); | 523 RELEASE_ASSERT(m_formElementsWithState.contains(control)); |
524 m_formElementsWithState.remove(control); | 524 m_formElementsWithState.remove(control); |
525 } | 525 } |
526 | 526 |
527 } // namespace WebCore | 527 } // namespace WebCore |
OLD | NEW |