Chromium Code Reviews| Index: Source/core/html/forms/FormController.h |
| diff --git a/Source/core/html/forms/FormController.h b/Source/core/html/forms/FormController.h |
| index 21d586004fa59c7dfec7d67281c3be8ea3b24635..40505d3e8e25d70fd0dfc5943523aabc365fdf6a 100644 |
| --- a/Source/core/html/forms/FormController.h |
| +++ b/Source/core/html/forms/FormController.h |
| @@ -71,6 +71,22 @@ inline void FormControlState::append(const String& value) |
| m_values.append(value); |
| } |
| +typedef HashMap<AtomicString, OwnPtr<SavedFormState> > SavedFormStateMap; |
| + |
| +class DocumentState : public RefCounted<DocumentState> { |
| +public: |
| + static PassRefPtr<DocumentState> create(); |
| + ~DocumentState(); |
| + |
| + void addControl(HTMLFormControlElementWithState*); |
| + void removeControl(HTMLFormControlElementWithState*); |
| + Vector<String> toStateVector(); |
| + |
| +private: |
| + typedef ListHashSet<RefPtr<HTMLFormControlElementWithState>, 64> FormElementListHashSet; |
| + FormElementListHashSet m_formControls; |
| +}; |
|
abarth-chromium
2014/04/17 23:41:24
Should this class have its own header?
Nate Chapin
2014/04/17 23:48:19
I was planning on that initially, but it was surpr
|
| + |
| class FormController { |
| WTF_MAKE_FAST_ALLOCATED; |
| public: |
| @@ -85,7 +101,7 @@ public: |
| void registerStatefulFormControl(HTMLFormControlElementWithState&); |
| void unregisterStatefulFormControl(HTMLFormControlElementWithState&); |
| // This should be callled only by Document::formElementsState(). |
| - Vector<String> formElementsState() const; |
| + DocumentState* formElementsState() const; |
| // This should be callled only by Document::setStateForNewFormElements(). |
| void setStateForNewFormElements(const Vector<String>&); |
| void willDeleteForm(HTMLFormElement*); |
| @@ -95,16 +111,12 @@ public: |
| static Vector<String> getReferencedFilePaths(const Vector<String>& stateVector); |
| private: |
| - typedef ListHashSet<RefPtr<HTMLFormControlElementWithState>, 64> FormElementListHashSet; |
| - typedef HashMap<AtomicString, OwnPtr<SavedFormState> > SavedFormStateMap; |
| - |
| FormController(); |
| - static PassOwnPtr<SavedFormStateMap> createSavedFormStateMap(const FormElementListHashSet&); |
| FormControlState takeStateForFormElement(const HTMLFormControlElementWithState&); |
| static void formStatesFromStateVector(const Vector<String>&, SavedFormStateMap&); |
| RadioButtonGroupScope m_radioButtonGroupScope; |
| - FormElementListHashSet m_formControls; |
| + RefPtr<DocumentState> m_documentState; |
| SavedFormStateMap m_savedFormStateMap; |
| OwnPtr<FormKeyGenerator> m_formKeyGenerator; |
| }; |