OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 m_type = TypeRestore; | 70 m_type = TypeRestore; |
71 m_values.append(value); | 71 m_values.append(value); |
72 } | 72 } |
73 | 73 |
74 typedef HashMap<AtomicString, OwnPtr<SavedFormState>> SavedFormStateMap; | 74 typedef HashMap<AtomicString, OwnPtr<SavedFormState>> SavedFormStateMap; |
75 | 75 |
76 class DocumentState final : public RefCountedWillBeGarbageCollected<DocumentStat
e> { | 76 class DocumentState final : public RefCountedWillBeGarbageCollected<DocumentStat
e> { |
77 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DocumentState); | 77 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DocumentState); |
78 public: | 78 public: |
79 static PassRefPtrWillBeRawPtr<DocumentState> create(); | 79 static PassRefPtrWillBeRawPtr<DocumentState> create(); |
80 void trace(Visitor*); | 80 DECLARE_TRACE(); |
81 | 81 |
82 void addControl(HTMLFormControlElementWithState*); | 82 void addControl(HTMLFormControlElementWithState*); |
83 void removeControl(HTMLFormControlElementWithState*); | 83 void removeControl(HTMLFormControlElementWithState*); |
84 Vector<String> toStateVector(); | 84 Vector<String> toStateVector(); |
85 | 85 |
86 private: | 86 private: |
87 typedef WillBeHeapListHashSet<RefPtrWillBeMember<HTMLFormControlElementWithS
tate>, 64> FormElementListHashSet; | 87 typedef WillBeHeapListHashSet<RefPtrWillBeMember<HTMLFormControlElementWithS
tate>, 64> FormElementListHashSet; |
88 FormElementListHashSet m_formControls; | 88 FormElementListHashSet m_formControls; |
89 }; | 89 }; |
90 | 90 |
91 class FormController final : public NoBaseWillBeGarbageCollectedFinalized<FormCo
ntroller> { | 91 class FormController final : public NoBaseWillBeGarbageCollectedFinalized<FormCo
ntroller> { |
92 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 92 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
93 public: | 93 public: |
94 static PassOwnPtrWillBeRawPtr<FormController> create() | 94 static PassOwnPtrWillBeRawPtr<FormController> create() |
95 { | 95 { |
96 return adoptPtrWillBeNoop(new FormController); | 96 return adoptPtrWillBeNoop(new FormController); |
97 } | 97 } |
98 ~FormController(); | 98 ~FormController(); |
99 void trace(Visitor*); | 99 DECLARE_TRACE(); |
100 | 100 |
101 RadioButtonGroupScope& radioButtonGroupScope() { return m_radioButtonGroupSc
ope; } | 101 RadioButtonGroupScope& radioButtonGroupScope() { return m_radioButtonGroupSc
ope; } |
102 | 102 |
103 void registerStatefulFormControl(HTMLFormControlElementWithState&); | 103 void registerStatefulFormControl(HTMLFormControlElementWithState&); |
104 void unregisterStatefulFormControl(HTMLFormControlElementWithState&); | 104 void unregisterStatefulFormControl(HTMLFormControlElementWithState&); |
105 // This should be callled only by Document::formElementsState(). | 105 // This should be callled only by Document::formElementsState(). |
106 DocumentState* formElementsState() const; | 106 DocumentState* formElementsState() const; |
107 // This should be callled only by Document::setStateForNewFormElements(). | 107 // This should be callled only by Document::setStateForNewFormElements(). |
108 void setStateForNewFormElements(const Vector<String>&); | 108 void setStateForNewFormElements(const Vector<String>&); |
109 void willDeleteForm(HTMLFormElement*); | 109 void willDeleteForm(HTMLFormElement*); |
110 void restoreControlStateFor(HTMLFormControlElementWithState&); | 110 void restoreControlStateFor(HTMLFormControlElementWithState&); |
111 void restoreControlStateIn(HTMLFormElement&); | 111 void restoreControlStateIn(HTMLFormElement&); |
112 | 112 |
113 static Vector<String> getReferencedFilePaths(const Vector<String>& stateVect
or); | 113 static Vector<String> getReferencedFilePaths(const Vector<String>& stateVect
or); |
114 | 114 |
115 private: | 115 private: |
116 FormController(); | 116 FormController(); |
117 FormControlState takeStateForFormElement(const HTMLFormControlElementWithSta
te&); | 117 FormControlState takeStateForFormElement(const HTMLFormControlElementWithSta
te&); |
118 static void formStatesFromStateVector(const Vector<String>&, SavedFormStateM
ap&); | 118 static void formStatesFromStateVector(const Vector<String>&, SavedFormStateM
ap&); |
119 | 119 |
120 RadioButtonGroupScope m_radioButtonGroupScope; | 120 RadioButtonGroupScope m_radioButtonGroupScope; |
121 RefPtrWillBeMember<DocumentState> m_documentState; | 121 RefPtrWillBeMember<DocumentState> m_documentState; |
122 SavedFormStateMap m_savedFormStateMap; | 122 SavedFormStateMap m_savedFormStateMap; |
123 OwnPtrWillBeMember<FormKeyGenerator> m_formKeyGenerator; | 123 OwnPtrWillBeMember<FormKeyGenerator> m_formKeyGenerator; |
124 }; | 124 }; |
125 | 125 |
126 } // namespace blink | 126 } // namespace blink |
127 #endif | 127 #endif |
OLD | NEW |