Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(855)

Unified Diff: Source/core/html/forms/FormController.h

Issue 239993011: Lazily generate HistoryItem's serialized form state (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged to trunk Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLFormControlElementWithState.cpp ('k') | Source/core/html/forms/FormController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+};
+
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;
};
« no previous file with comments | « Source/core/html/HTMLFormControlElementWithState.cpp ('k') | Source/core/html/forms/FormController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698