OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 108 matching lines...) Loading... |
119 : RecordWithEmptyNodeLists(target, oldValue) | 119 : RecordWithEmptyNodeLists(target, oldValue) |
120 { | 120 { |
121 } | 121 } |
122 | 122 |
123 private: | 123 private: |
124 virtual const AtomicString& type() OVERRIDE; | 124 virtual const AtomicString& type() OVERRIDE; |
125 }; | 125 }; |
126 | 126 |
127 class MutationRecordWithNullOldValue : public MutationRecord { | 127 class MutationRecordWithNullOldValue : public MutationRecord { |
128 public: | 128 public: |
129 MutationRecordWithNullOldValue(PassRefPtr<MutationRecord> record) | 129 MutationRecordWithNullOldValue(PassRefPtrWillBeRawPtr<MutationRecord> record
) |
130 : m_record(record) | 130 : m_record(record) |
131 { | 131 { |
132 } | 132 } |
133 | 133 |
| 134 virtual void trace(Visitor* visitor) OVERRIDE |
| 135 { |
| 136 visitor->trace(m_record); |
| 137 MutationRecord::trace(visitor); |
| 138 } |
| 139 |
134 private: | 140 private: |
135 virtual const AtomicString& type() OVERRIDE { return m_record->type(); } | 141 virtual const AtomicString& type() OVERRIDE { return m_record->type(); } |
136 virtual Node* target() OVERRIDE { return m_record->target(); } | 142 virtual Node* target() OVERRIDE { return m_record->target(); } |
137 virtual NodeList* addedNodes() OVERRIDE { return m_record->addedNodes(); } | 143 virtual NodeList* addedNodes() OVERRIDE { return m_record->addedNodes(); } |
138 virtual NodeList* removedNodes() OVERRIDE { return m_record->removedNodes();
} | 144 virtual NodeList* removedNodes() OVERRIDE { return m_record->removedNodes();
} |
139 virtual Node* previousSibling() OVERRIDE { return m_record->previousSibling(
); } | 145 virtual Node* previousSibling() OVERRIDE { return m_record->previousSibling(
); } |
140 virtual Node* nextSibling() OVERRIDE { return m_record->nextSibling(); } | 146 virtual Node* nextSibling() OVERRIDE { return m_record->nextSibling(); } |
141 virtual const AtomicString& attributeName() OVERRIDE { return m_record->attr
ibuteName(); } | 147 virtual const AtomicString& attributeName() OVERRIDE { return m_record->attr
ibuteName(); } |
142 virtual const AtomicString& attributeNamespace() OVERRIDE { return m_record-
>attributeNamespace(); } | 148 virtual const AtomicString& attributeNamespace() OVERRIDE { return m_record-
>attributeNamespace(); } |
143 | 149 |
144 virtual String oldValue() OVERRIDE { return String(); } | 150 virtual String oldValue() OVERRIDE { return String(); } |
145 | 151 |
146 RefPtr<MutationRecord> m_record; | 152 RefPtrWillBeMember<MutationRecord> m_record; |
147 }; | 153 }; |
148 | 154 |
149 const AtomicString& ChildListRecord::type() | 155 const AtomicString& ChildListRecord::type() |
150 { | 156 { |
151 DEFINE_STATIC_LOCAL(AtomicString, childList, ("childList", AtomicString::Con
structFromLiteral)); | 157 DEFINE_STATIC_LOCAL(AtomicString, childList, ("childList", AtomicString::Con
structFromLiteral)); |
152 return childList; | 158 return childList; |
153 } | 159 } |
154 | 160 |
155 const AtomicString& AttributesRecord::type() | 161 const AtomicString& AttributesRecord::type() |
156 { | 162 { |
157 DEFINE_STATIC_LOCAL(AtomicString, attributes, ("attributes", AtomicString::C
onstructFromLiteral)); | 163 DEFINE_STATIC_LOCAL(AtomicString, attributes, ("attributes", AtomicString::C
onstructFromLiteral)); |
158 return attributes; | 164 return attributes; |
159 } | 165 } |
160 | 166 |
161 const AtomicString& CharacterDataRecord::type() | 167 const AtomicString& CharacterDataRecord::type() |
162 { | 168 { |
163 DEFINE_STATIC_LOCAL(AtomicString, characterData, ("characterData", AtomicStr
ing::ConstructFromLiteral)); | 169 DEFINE_STATIC_LOCAL(AtomicString, characterData, ("characterData", AtomicStr
ing::ConstructFromLiteral)); |
164 return characterData; | 170 return characterData; |
165 } | 171 } |
166 | 172 |
167 } // namespace | 173 } // namespace |
168 | 174 |
169 PassRefPtr<MutationRecord> MutationRecord::createChildList(PassRefPtr<Node> targ
et, PassRefPtr<NodeList> added, PassRefPtr<NodeList> removed, PassRefPtr<Node> p
reviousSibling, PassRefPtr<Node> nextSibling) | 175 PassRefPtrWillBeRawPtr<MutationRecord> MutationRecord::createChildList(PassRefPt
r<Node> target, PassRefPtr<NodeList> added, PassRefPtr<NodeList> removed, PassRe
fPtr<Node> previousSibling, PassRefPtr<Node> nextSibling) |
170 { | 176 { |
171 return adoptRef(new ChildListRecord(target, added, removed, previousSibling,
nextSibling)); | 177 return adoptRefWillBeNoop(new ChildListRecord(target, added, removed, previo
usSibling, nextSibling)); |
172 } | 178 } |
173 | 179 |
174 PassRefPtr<MutationRecord> MutationRecord::createAttributes(PassRefPtr<Node> tar
get, const QualifiedName& name, const AtomicString& oldValue) | 180 PassRefPtrWillBeRawPtr<MutationRecord> MutationRecord::createAttributes(PassRefP
tr<Node> target, const QualifiedName& name, const AtomicString& oldValue) |
175 { | 181 { |
176 return adoptRef(new AttributesRecord(target, name, oldValue)); | 182 return adoptRefWillBeNoop(new AttributesRecord(target, name, oldValue)); |
177 } | 183 } |
178 | 184 |
179 PassRefPtr<MutationRecord> MutationRecord::createCharacterData(PassRefPtr<Node>
target, const String& oldValue) | 185 PassRefPtrWillBeRawPtr<MutationRecord> MutationRecord::createCharacterData(PassR
efPtr<Node> target, const String& oldValue) |
180 { | 186 { |
181 return adoptRef(new CharacterDataRecord(target, oldValue)); | 187 return adoptRefWillBeNoop(new CharacterDataRecord(target, oldValue)); |
182 } | 188 } |
183 | 189 |
184 PassRefPtr<MutationRecord> MutationRecord::createWithNullOldValue(PassRefPtr<Mut
ationRecord> record) | 190 PassRefPtrWillBeRawPtr<MutationRecord> MutationRecord::createWithNullOldValue(Pa
ssRefPtrWillBeRawPtr<MutationRecord> record) |
185 { | 191 { |
186 return adoptRef(new MutationRecordWithNullOldValue(record)); | 192 return adoptRefWillBeNoop(new MutationRecordWithNullOldValue(record)); |
187 } | 193 } |
188 | 194 |
189 MutationRecord::~MutationRecord() | 195 MutationRecord::~MutationRecord() |
190 { | 196 { |
191 } | 197 } |
192 | 198 |
193 } // namespace WebCore | 199 } // namespace WebCore |
OLD | NEW |