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

Side by Side Diff: Source/core/html/forms/FormController.cpp

Issue 934163004: Modernize coding style in core/html/forms/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/forms/FormController.h ('k') | Source/core/html/forms/HiddenInputType.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 void serializeTo(Vector<String>&) const; 182 void serializeTo(Vector<String>&) const;
183 bool isEmpty() const { return m_stateForNewFormElements.isEmpty(); } 183 bool isEmpty() const { return m_stateForNewFormElements.isEmpty(); }
184 void appendControlState(const AtomicString& name, const AtomicString& type, const FormControlState&); 184 void appendControlState(const AtomicString& name, const AtomicString& type, const FormControlState&);
185 FormControlState takeControlState(const AtomicString& name, const AtomicStri ng& type); 185 FormControlState takeControlState(const AtomicString& name, const AtomicStri ng& type);
186 186
187 Vector<String> getReferencedFilePaths() const; 187 Vector<String> getReferencedFilePaths() const;
188 188
189 private: 189 private:
190 SavedFormState() : m_controlStateCount(0) { } 190 SavedFormState() : m_controlStateCount(0) { }
191 191
192 typedef HashMap<FormElementKey, Deque<FormControlState>, FormElementKeyHash, FormElementKeyHashTraits> FormElementStateMap; 192 using FormElementStateMap = HashMap<FormElementKey, Deque<FormControlState>, FormElementKeyHash, FormElementKeyHashTraits>;
193 FormElementStateMap m_stateForNewFormElements; 193 FormElementStateMap m_stateForNewFormElements;
194 size_t m_controlStateCount; 194 size_t m_controlStateCount;
195 }; 195 };
196 196
197 PassOwnPtr<SavedFormState> SavedFormState::create() 197 PassOwnPtr<SavedFormState> SavedFormState::create()
198 { 198 {
199 return adoptPtr(new SavedFormState); 199 return adoptPtr(new SavedFormState);
200 } 200 }
201 201
202 static bool isNotFormControlTypeCharacter(UChar ch) 202 static bool isNotFormControlTypeCharacter(UChar ch)
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 #if ENABLE(OILPAN) 299 #if ENABLE(OILPAN)
300 visitor->trace(m_formToKeyMap); 300 visitor->trace(m_formToKeyMap);
301 #endif 301 #endif
302 } 302 }
303 const AtomicString& formKey(const HTMLFormControlElementWithState&); 303 const AtomicString& formKey(const HTMLFormControlElementWithState&);
304 void willDeleteForm(HTMLFormElement*); 304 void willDeleteForm(HTMLFormElement*);
305 305
306 private: 306 private:
307 FormKeyGenerator() { } 307 FormKeyGenerator() { }
308 308
309 typedef WillBeHeapHashMap<RawPtrWillBeMember<HTMLFormElement>, AtomicString> FormToKeyMap; 309 using FormToKeyMap = WillBeHeapHashMap<RawPtrWillBeMember<HTMLFormElement>, AtomicString>;
310 typedef HashMap<String, unsigned> FormSignatureToNextIndexMap; 310 using FormSignatureToNextIndexMap = HashMap<String, unsigned>;
311 FormToKeyMap m_formToKeyMap; 311 FormToKeyMap m_formToKeyMap;
312 FormSignatureToNextIndexMap m_formSignatureToNextIndexMap; 312 FormSignatureToNextIndexMap m_formSignatureToNextIndexMap;
313 }; 313 };
314 314
315 static inline void recordFormStructure(const HTMLFormElement& form, StringBuilde r& builder) 315 static inline void recordFormStructure(const HTMLFormElement& form, StringBuilde r& builder)
316 { 316 {
317 // 2 is enough to distinguish forms in webkit.org/b/91209#c0 317 // 2 is enough to distinguish forms in webkit.org/b/91209#c0
318 const size_t namedControlsToBeRecorded = 2; 318 const size_t namedControlsToBeRecorded = 2;
319 const FormAssociatedElement::List& controls = form.associatedElements(); 319 const FormAssociatedElement::List& controls = form.associatedElements();
320 builder.appendLiteral(" ["); 320 builder.appendLiteral(" [");
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 { 560 {
561 m_documentState->addControl(&control); 561 m_documentState->addControl(&control);
562 } 562 }
563 563
564 void FormController::unregisterStatefulFormControl(HTMLFormControlElementWithSta te& control) 564 void FormController::unregisterStatefulFormControl(HTMLFormControlElementWithSta te& control)
565 { 565 {
566 m_documentState->removeControl(&control); 566 m_documentState->removeControl(&control);
567 } 567 }
568 568
569 } // namespace blink 569 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/forms/FormController.h ('k') | Source/core/html/forms/HiddenInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698