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

Side by Side Diff: sky/engine/core/dom/MutationRecord.cpp

Issue 723253004: Remove tons of OILPAN. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/dom/MutationRecord.h ('k') | sky/engine/core/dom/Node.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) 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 public: 46 public:
47 ChildListRecord(PassRefPtr<Node> target, PassRefPtr<StaticNodeList> added, P assRefPtr<StaticNodeList> removed, PassRefPtr<Node> previousSibling, PassRefPtr< Node> nextSibling) 47 ChildListRecord(PassRefPtr<Node> target, PassRefPtr<StaticNodeList> added, P assRefPtr<StaticNodeList> removed, PassRefPtr<Node> previousSibling, PassRefPtr< Node> nextSibling)
48 : m_target(target) 48 : m_target(target)
49 , m_addedNodes(added) 49 , m_addedNodes(added)
50 , m_removedNodes(removed) 50 , m_removedNodes(removed)
51 , m_previousSibling(previousSibling) 51 , m_previousSibling(previousSibling)
52 , m_nextSibling(nextSibling) 52 , m_nextSibling(nextSibling)
53 { 53 {
54 } 54 }
55 55
56 virtual void trace(Visitor* visitor) override
57 {
58 visitor->trace(m_target);
59 visitor->trace(m_addedNodes);
60 visitor->trace(m_removedNodes);
61 visitor->trace(m_previousSibling);
62 visitor->trace(m_nextSibling);
63 MutationRecord::trace(visitor);
64 }
65
66 private: 56 private:
67 virtual const AtomicString& type() override; 57 virtual const AtomicString& type() override;
68 virtual Node* target() override { return m_target.get(); } 58 virtual Node* target() override { return m_target.get(); }
69 virtual StaticNodeList* addedNodes() override { return m_addedNodes.get(); } 59 virtual StaticNodeList* addedNodes() override { return m_addedNodes.get(); }
70 virtual StaticNodeList* removedNodes() override { return m_removedNodes.get( ); } 60 virtual StaticNodeList* removedNodes() override { return m_removedNodes.get( ); }
71 virtual Node* previousSibling() override { return m_previousSibling.get(); } 61 virtual Node* previousSibling() override { return m_previousSibling.get(); }
72 virtual Node* nextSibling() override { return m_nextSibling.get(); } 62 virtual Node* nextSibling() override { return m_nextSibling.get(); }
73 63
74 RefPtr<Node> m_target; 64 RefPtr<Node> m_target;
75 RefPtr<StaticNodeList> m_addedNodes; 65 RefPtr<StaticNodeList> m_addedNodes;
76 RefPtr<StaticNodeList> m_removedNodes; 66 RefPtr<StaticNodeList> m_removedNodes;
77 RefPtr<Node> m_previousSibling; 67 RefPtr<Node> m_previousSibling;
78 RefPtr<Node> m_nextSibling; 68 RefPtr<Node> m_nextSibling;
79 }; 69 };
80 70
81 class RecordWithEmptyNodeLists : public MutationRecord { 71 class RecordWithEmptyNodeLists : public MutationRecord {
82 public: 72 public:
83 RecordWithEmptyNodeLists(PassRefPtr<Node> target, const String& oldValue) 73 RecordWithEmptyNodeLists(PassRefPtr<Node> target, const String& oldValue)
84 : m_target(target) 74 : m_target(target)
85 , m_oldValue(oldValue) 75 , m_oldValue(oldValue)
86 { 76 {
87 } 77 }
88 78
89 virtual void trace(Visitor* visitor) override
90 {
91 visitor->trace(m_target);
92 visitor->trace(m_addedNodes);
93 visitor->trace(m_removedNodes);
94 MutationRecord::trace(visitor);
95 }
96
97 private: 79 private:
98 virtual Node* target() override { return m_target.get(); } 80 virtual Node* target() override { return m_target.get(); }
99 virtual String oldValue() override { return m_oldValue; } 81 virtual String oldValue() override { return m_oldValue; }
100 virtual StaticNodeList* addedNodes() override { return lazilyInitializeEmpty NodeList(m_addedNodes); } 82 virtual StaticNodeList* addedNodes() override { return lazilyInitializeEmpty NodeList(m_addedNodes); }
101 virtual StaticNodeList* removedNodes() override { return lazilyInitializeEmp tyNodeList(m_removedNodes); } 83 virtual StaticNodeList* removedNodes() override { return lazilyInitializeEmp tyNodeList(m_removedNodes); }
102 84
103 static StaticNodeList* lazilyInitializeEmptyNodeList(RefPtr<StaticNodeList>& nodeList) 85 static StaticNodeList* lazilyInitializeEmptyNodeList(RefPtr<StaticNodeList>& nodeList)
104 { 86 {
105 if (!nodeList) 87 if (!nodeList)
106 nodeList = StaticNodeList::createEmpty(); 88 nodeList = StaticNodeList::createEmpty();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 virtual const AtomicString& type() override; 121 virtual const AtomicString& type() override;
140 }; 122 };
141 123
142 class MutationRecordWithNullOldValue : public MutationRecord { 124 class MutationRecordWithNullOldValue : public MutationRecord {
143 public: 125 public:
144 MutationRecordWithNullOldValue(PassRefPtr<MutationRecord> record) 126 MutationRecordWithNullOldValue(PassRefPtr<MutationRecord> record)
145 : m_record(record) 127 : m_record(record)
146 { 128 {
147 } 129 }
148 130
149 virtual void trace(Visitor* visitor) override
150 {
151 visitor->trace(m_record);
152 MutationRecord::trace(visitor);
153 }
154
155 private: 131 private:
156 virtual const AtomicString& type() override { return m_record->type(); } 132 virtual const AtomicString& type() override { return m_record->type(); }
157 virtual Node* target() override { return m_record->target(); } 133 virtual Node* target() override { return m_record->target(); }
158 virtual StaticNodeList* addedNodes() override { return m_record->addedNodes( ); } 134 virtual StaticNodeList* addedNodes() override { return m_record->addedNodes( ); }
159 virtual StaticNodeList* removedNodes() override { return m_record->removedNo des(); } 135 virtual StaticNodeList* removedNodes() override { return m_record->removedNo des(); }
160 virtual Node* previousSibling() override { return m_record->previousSibling( ); } 136 virtual Node* previousSibling() override { return m_record->previousSibling( ); }
161 virtual Node* nextSibling() override { return m_record->nextSibling(); } 137 virtual Node* nextSibling() override { return m_record->nextSibling(); }
162 virtual const AtomicString& attributeName() override { return m_record->attr ibuteName(); } 138 virtual const AtomicString& attributeName() override { return m_record->attr ibuteName(); }
163 139
164 virtual String oldValue() override { return String(); } 140 virtual String oldValue() override { return String(); }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 PassRefPtr<MutationRecord> MutationRecord::createWithNullOldValue(PassRefPtr<Mut ationRecord> record) 180 PassRefPtr<MutationRecord> MutationRecord::createWithNullOldValue(PassRefPtr<Mut ationRecord> record)
205 { 181 {
206 return adoptRef(new MutationRecordWithNullOldValue(record)); 182 return adoptRef(new MutationRecordWithNullOldValue(record));
207 } 183 }
208 184
209 MutationRecord::~MutationRecord() 185 MutationRecord::~MutationRecord()
210 { 186 {
211 } 187 }
212 188
213 } // namespace blink 189 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/MutationRecord.h ('k') | sky/engine/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698