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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 state.m_values.reserveCapacity(valueSize); | 74 state.m_values.reserveCapacity(valueSize); |
75 for (size_t i = 0; i < valueSize; ++i) | 75 for (size_t i = 0; i < valueSize; ++i) |
76 state.append(stateVector[index++]); | 76 state.append(stateVector[index++]); |
77 return state; | 77 return state; |
78 } | 78 } |
79 | 79 |
80 // ---------------------------------------------------------------------------- | 80 // ---------------------------------------------------------------------------- |
81 | 81 |
82 class FormElementKey { | 82 class FormElementKey { |
83 public: | 83 public: |
84 FormElementKey(AtomicStringImpl* = 0, AtomicStringImpl* = 0); | 84 FormElementKey(StringImpl* = 0, StringImpl* = 0); |
85 ~FormElementKey(); | 85 ~FormElementKey(); |
86 FormElementKey(const FormElementKey&); | 86 FormElementKey(const FormElementKey&); |
87 FormElementKey& operator=(const FormElementKey&); | 87 FormElementKey& operator=(const FormElementKey&); |
88 | 88 |
89 AtomicStringImpl* name() const { return m_name; } | 89 StringImpl* name() const { return m_name; } |
90 AtomicStringImpl* type() const { return m_type; } | 90 StringImpl* type() const { return m_type; } |
91 | 91 |
92 // Hash table deleted values, which are only constructed and never copied or
destroyed. | 92 // Hash table deleted values, which are only constructed and never copied or
destroyed. |
93 FormElementKey(WTF::HashTableDeletedValueType) : m_name(hashTableDeletedValu
e()) { } | 93 FormElementKey(WTF::HashTableDeletedValueType) : m_name(hashTableDeletedValu
e()) { } |
94 bool isHashTableDeletedValue() const { return m_name == hashTableDeletedValu
e(); } | 94 bool isHashTableDeletedValue() const { return m_name == hashTableDeletedValu
e(); } |
95 | 95 |
96 private: | 96 private: |
97 void ref() const; | 97 void ref() const; |
98 void deref() const; | 98 void deref() const; |
99 | 99 |
100 static AtomicStringImpl* hashTableDeletedValue() { return reinterpret_cast<A
tomicStringImpl*>(-1); } | 100 static StringImpl* hashTableDeletedValue() { return reinterpret_cast<StringI
mpl*>(-1); } |
101 | 101 |
102 AtomicStringImpl* m_name; | 102 StringImpl* m_name; |
103 AtomicStringImpl* m_type; | 103 StringImpl* m_type; |
104 }; | 104 }; |
105 | 105 |
106 FormElementKey::FormElementKey(AtomicStringImpl* name, AtomicStringImpl* type) | 106 FormElementKey::FormElementKey(StringImpl* name, StringImpl* type) |
107 : m_name(name) | 107 : m_name(name) |
108 , m_type(type) | 108 , m_type(type) |
109 { | 109 { |
110 ref(); | 110 ref(); |
111 } | 111 } |
112 | 112 |
113 FormElementKey::~FormElementKey() | 113 FormElementKey::~FormElementKey() |
114 { | 114 { |
115 deref(); | 115 deref(); |
116 } | 116 } |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 m_formElementsWithState.add(control); | 517 m_formElementsWithState.add(control); |
518 } | 518 } |
519 | 519 |
520 void FormController::unregisterFormElementWithState(HTMLFormControlElementWithSt
ate* control) | 520 void FormController::unregisterFormElementWithState(HTMLFormControlElementWithSt
ate* control) |
521 { | 521 { |
522 RELEASE_ASSERT(m_formElementsWithState.contains(control)); | 522 RELEASE_ASSERT(m_formElementsWithState.contains(control)); |
523 m_formElementsWithState.remove(control); | 523 m_formElementsWithState.remove(control); |
524 } | 524 } |
525 | 525 |
526 } // namespace WebCore | 526 } // namespace WebCore |
OLD | NEW |