| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 // contain some characters which are rarely used for name attribute values. | 406 // contain some characters which are rarely used for name attribute values. |
| 407 DEFINE_STATIC_LOCAL(String, signature, ("\n\r?% WebKit serialized form state
version 8 \n\r=&")); | 407 DEFINE_STATIC_LOCAL(String, signature, ("\n\r?% WebKit serialized form state
version 8 \n\r=&")); |
| 408 return signature; | 408 return signature; |
| 409 } | 409 } |
| 410 | 410 |
| 411 Vector<String> DocumentState::toStateVector() | 411 Vector<String> DocumentState::toStateVector() |
| 412 { | 412 { |
| 413 OwnPtrWillBeRawPtr<FormKeyGenerator> keyGenerator = FormKeyGenerator::create
(); | 413 OwnPtrWillBeRawPtr<FormKeyGenerator> keyGenerator = FormKeyGenerator::create
(); |
| 414 OwnPtr<SavedFormStateMap> stateMap = adoptPtr(new SavedFormStateMap); | 414 OwnPtr<SavedFormStateMap> stateMap = adoptPtr(new SavedFormStateMap); |
| 415 for (FormElementListHashSet::const_iterator it = m_formControls.begin(); it
!= m_formControls.end(); ++it) { | 415 for (FormElementListHashSet::const_iterator it = m_formControls.begin(); it
!= m_formControls.end(); ++it) { |
| 416 HTMLFormControlElementWithState* control = (*it).get(); | 416 HTMLFormControlElementWithState* control = it->get(); |
| 417 ASSERT(control->inDocument()); | 417 ASSERT(control->inDocument()); |
| 418 if (!control->shouldSaveAndRestoreFormControlState()) | 418 if (!control->shouldSaveAndRestoreFormControlState()) |
| 419 continue; | 419 continue; |
| 420 SavedFormStateMap::AddResult result = stateMap->add(keyGenerator->formKe
y(*control), nullptr); | 420 SavedFormStateMap::AddResult result = stateMap->add(keyGenerator->formKe
y(*control), nullptr); |
| 421 if (result.isNewEntry) | 421 if (result.isNewEntry) |
| 422 result.storedValue->value = SavedFormState::create(); | 422 result.storedValue->value = SavedFormState::create(); |
| 423 result.storedValue->value->appendControlState(control->name(), control->
type(), control->saveFormControlState()); | 423 result.storedValue->value->appendControlState(control->name(), control->
type(), control->saveFormControlState()); |
| 424 } | 424 } |
| 425 | 425 |
| 426 Vector<String> stateVector; | 426 Vector<String> stateVector; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 { | 551 { |
| 552 m_documentState->addControl(&control); | 552 m_documentState->addControl(&control); |
| 553 } | 553 } |
| 554 | 554 |
| 555 void FormController::unregisterStatefulFormControl(HTMLFormControlElementWithSta
te& control) | 555 void FormController::unregisterStatefulFormControl(HTMLFormControlElementWithSta
te& control) |
| 556 { | 556 { |
| 557 m_documentState->removeControl(&control); | 557 m_documentState->removeControl(&control); |
| 558 } | 558 } |
| 559 | 559 |
| 560 } // namespace WebCore | 560 } // namespace WebCore |
| OLD | NEW |