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

Side by Side Diff: third_party/WebKit/Source/core/dom/shadow/ShadowRootRareDataV0.h

Issue 1904923002: Reduce a shadow root object's size by not inheriting DoublyLinkedList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@raredatav0
Patch Set: fix typo Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp ('k') | no next file » | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 bool containsShadowElements() const { return m_descendantShadowElementCount; } 53 bool containsShadowElements() const { return m_descendantShadowElementCount; }
54 bool containsContentElements() const { return m_descendantContentElementCoun t; } 54 bool containsContentElements() const { return m_descendantContentElementCoun t; }
55 55
56 unsigned descendantShadowElementCount() const { return m_descendantShadowEle mentCount; } 56 unsigned descendantShadowElementCount() const { return m_descendantShadowEle mentCount; }
57 57
58 const HeapVector<Member<InsertionPoint>>& descendantInsertionPoints() { retu rn m_descendantInsertionPoints; } 58 const HeapVector<Member<InsertionPoint>>& descendantInsertionPoints() { retu rn m_descendantInsertionPoints; }
59 void setDescendantInsertionPoints(HeapVector<Member<InsertionPoint>>& list) { m_descendantInsertionPoints.swap(list); } 59 void setDescendantInsertionPoints(HeapVector<Member<InsertionPoint>>& list) { m_descendantInsertionPoints.swap(list); }
60 void clearDescendantInsertionPoints() { m_descendantInsertionPoints.clear(); } 60 void clearDescendantInsertionPoints() { m_descendantInsertionPoints.clear(); }
61 61
62 void setYoungerShadowRoot(ShadowRoot& youngerShadowRoot) { m_youngerShadowRo ot = &youngerShadowRoot; }
63 void setOlderShadowRoot(ShadowRoot& olderShadowRoot) { m_olderShadowRoot = & olderShadowRoot; }
64
65 ShadowRoot* youngerShadowRoot() const { return m_youngerShadowRoot; }
66 ShadowRoot* olderShadowRoot() const { return m_olderShadowRoot; }
67
62 DEFINE_INLINE_TRACE() 68 DEFINE_INLINE_TRACE()
63 { 69 {
70 visitor->trace(m_youngerShadowRoot);
71 visitor->trace(m_olderShadowRoot);
64 visitor->trace(m_shadowInsertionPointOfYoungerShadowRoot); 72 visitor->trace(m_shadowInsertionPointOfYoungerShadowRoot);
65 visitor->trace(m_descendantInsertionPoints); 73 visitor->trace(m_descendantInsertionPoints);
66 } 74 }
67 75
68 private: 76 private:
77 Member<ShadowRoot> m_youngerShadowRoot;
78 Member<ShadowRoot> m_olderShadowRoot;
69 Member<HTMLShadowElement> m_shadowInsertionPointOfYoungerShadowRoot; 79 Member<HTMLShadowElement> m_shadowInsertionPointOfYoungerShadowRoot;
70 unsigned m_descendantShadowElementCount; 80 unsigned m_descendantShadowElementCount;
71 unsigned m_descendantContentElementCount; 81 unsigned m_descendantContentElementCount;
72 HeapVector<Member<InsertionPoint>> m_descendantInsertionPoints; 82 HeapVector<Member<InsertionPoint>> m_descendantInsertionPoints;
73 }; 83 };
74 84
75 inline void ShadowRootRareDataV0::didAddInsertionPoint(InsertionPoint* point) 85 inline void ShadowRootRareDataV0::didAddInsertionPoint(InsertionPoint* point)
76 { 86 {
77 DCHECK(point); 87 DCHECK(point);
78 if (isHTMLShadowElement(*point)) 88 if (isHTMLShadowElement(*point))
(...skipping 14 matching lines...) Expand all
93 DCHECK_GT(m_descendantContentElementCount, 0u); 103 DCHECK_GT(m_descendantContentElementCount, 0u);
94 --m_descendantContentElementCount; 104 --m_descendantContentElementCount;
95 } else { 105 } else {
96 ASSERT_NOT_REACHED(); 106 ASSERT_NOT_REACHED();
97 } 107 }
98 } 108 }
99 109
100 } // namespace blink 110 } // namespace blink
101 111
102 #endif 112 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698