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 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef MutationRecord_h | 31 #ifndef MutationRecord_h |
32 #define MutationRecord_h | 32 #define MutationRecord_h |
33 | 33 |
34 #include "bindings/v8/ScriptWrappable.h" | 34 #include "bindings/v8/ScriptWrappable.h" |
| 35 #include "platform/heap/Handle.h" |
35 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
36 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
37 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
38 | 39 |
39 namespace WebCore { | 40 namespace WebCore { |
40 | 41 |
41 class Node; | 42 class Node; |
42 class NodeList; | 43 class NodeList; |
43 class QualifiedName; | 44 class QualifiedName; |
44 | 45 |
45 class MutationRecord : public RefCounted<MutationRecord>, public ScriptWrappable
{ | 46 class MutationRecord : public RefCountedWillBeGarbageCollectedFinalized<Mutation
Record>, public ScriptWrappable { |
46 public: | 47 public: |
47 static PassRefPtr<MutationRecord> createChildList(PassRefPtr<Node> target, P
assRefPtr<NodeList> added, PassRefPtr<NodeList> removed, PassRefPtr<Node> previo
usSibling, PassRefPtr<Node> nextSibling); | 48 static PassRefPtrWillBeRawPtr<MutationRecord> createChildList(PassRefPtr<Nod
e> target, PassRefPtr<NodeList> added, PassRefPtr<NodeList> removed, PassRefPtr<
Node> previousSibling, PassRefPtr<Node> nextSibling); |
48 static PassRefPtr<MutationRecord> createAttributes(PassRefPtr<Node> target,
const QualifiedName&, const AtomicString& oldValue); | 49 static PassRefPtrWillBeRawPtr<MutationRecord> createAttributes(PassRefPtr<No
de> target, const QualifiedName&, const AtomicString& oldValue); |
49 static PassRefPtr<MutationRecord> createCharacterData(PassRefPtr<Node> targe
t, const String& oldValue); | 50 static PassRefPtrWillBeRawPtr<MutationRecord> createCharacterData(PassRefPtr
<Node> target, const String& oldValue); |
50 static PassRefPtr<MutationRecord> createWithNullOldValue(PassRefPtr<Mutation
Record>); | 51 static PassRefPtrWillBeRawPtr<MutationRecord> createWithNullOldValue(PassRef
PtrWillBeRawPtr<MutationRecord>); |
51 | 52 |
52 MutationRecord() | 53 MutationRecord() |
53 { | 54 { |
54 ScriptWrappable::init(this); | 55 ScriptWrappable::init(this); |
55 } | 56 } |
56 | 57 |
57 virtual ~MutationRecord(); | 58 virtual ~MutationRecord(); |
58 | 59 |
59 virtual const AtomicString& type() = 0; | 60 virtual const AtomicString& type() = 0; |
60 virtual Node* target() = 0; | 61 virtual Node* target() = 0; |
61 | 62 |
62 virtual NodeList* addedNodes() = 0; | 63 virtual NodeList* addedNodes() = 0; |
63 virtual NodeList* removedNodes() = 0; | 64 virtual NodeList* removedNodes() = 0; |
64 virtual Node* previousSibling() { return 0; } | 65 virtual Node* previousSibling() { return 0; } |
65 virtual Node* nextSibling() { return 0; } | 66 virtual Node* nextSibling() { return 0; } |
66 | 67 |
67 virtual const AtomicString& attributeName() { return nullAtom; } | 68 virtual const AtomicString& attributeName() { return nullAtom; } |
68 virtual const AtomicString& attributeNamespace() { return nullAtom; } | 69 virtual const AtomicString& attributeNamespace() { return nullAtom; } |
69 | 70 |
70 virtual String oldValue() { return String(); } | 71 virtual String oldValue() { return String(); } |
| 72 |
| 73 virtual void trace(Visitor*) { } |
| 74 |
71 }; | 75 }; |
72 | 76 |
73 } // namespace WebCore | 77 } // namespace WebCore |
74 | 78 |
75 #endif // MutationRecord_h | 79 #endif // MutationRecord_h |
OLD | NEW |