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

Unified Diff: third_party/WebKit/Source/core/dom/shadow/ElementShadow.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/shadow/ElementShadow.h
diff --git a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h
index 7725df6aa055ef3b79e209dc67243aa4be5327e2..a8aa549dbe62559ca07790f41cb0e23c3c5b6ae1 100644
--- a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h
+++ b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h
@@ -32,7 +32,6 @@
#include "core/dom/shadow/SelectRuleFeatureSet.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "platform/heap/Handle.h"
-#include "wtf/DoublyLinkedList.h"
#include "wtf/HashMap.h"
#include "wtf/Noncopyable.h"
@@ -45,8 +44,8 @@ public:
~ElementShadow();
Element* host() const;
- ShadowRoot& youngestShadowRoot() const { DCHECK(m_shadowRoots.head()); return *m_shadowRoots.head(); }
- ShadowRoot* oldestShadowRoot() const { return m_shadowRoots.tail(); }
+ ShadowRoot& youngestShadowRoot() const;
+ ShadowRoot* oldestShadowRoot() const { return m_shadowRoot; }
ElementShadow* containingShadow() const;
ShadowRoot& addShadowRoot(Element& shadowHost, ShadowRootType);
@@ -76,6 +75,8 @@ public:
private:
ElementShadow();
+ void appendShadowRoot(ShadowRoot&);
+
void distribute();
void clearDistribution();
@@ -92,16 +93,15 @@ private:
NodeToDestinationInsertionPoints m_nodeToInsertionPoints;
SelectRuleFeatureSet m_selectFeatures;
- // TODO(Oilpan): add a heap-based version of DoublyLinkedList<>.
- DoublyLinkedList<ShadowRoot> m_shadowRoots;
+ Member<ShadowRoot> m_shadowRoot;
bool m_needsDistributionRecalc;
bool m_needsSelectFeatureSet;
};
inline Element* ElementShadow::host() const
{
- DCHECK(!m_shadowRoots.isEmpty());
- return youngestShadowRoot().host();
+ DCHECK(m_shadowRoot);
+ return m_shadowRoot->host();
}
inline ShadowRoot* Node::youngestShadowRoot() const
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698