| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 size_t itemCount = stateVector[index++].toUInt(); | 212 size_t itemCount = stateVector[index++].toUInt(); |
| 213 if (!itemCount) | 213 if (!itemCount) |
| 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) != notFou
nd || 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(name, 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) { |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 m_formElementsWithState.add(control); | 519 m_formElementsWithState.add(control); |
| 520 } | 520 } |
| 521 | 521 |
| 522 void FormController::unregisterFormElementWithState(HTMLFormControlElementWithSt
ate* control) | 522 void FormController::unregisterFormElementWithState(HTMLFormControlElementWithSt
ate* control) |
| 523 { | 523 { |
| 524 RELEASE_ASSERT(m_formElementsWithState.contains(control)); | 524 RELEASE_ASSERT(m_formElementsWithState.contains(control)); |
| 525 m_formElementsWithState.remove(control); | 525 m_formElementsWithState.remove(control); |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace WebCore | 528 } // namespace WebCore |
| OLD | NEW |