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

Unified Diff: Source/core/dom/shadow/ElementShadow.cpp

Issue 23766020: Trivial changes to default Vector sizing in the shadow area. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
Index: Source/core/dom/shadow/ElementShadow.cpp
diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp
index bc4fb9ff822c50c07fdf09731a475b9ad2b61936..1f25ddb0e36964989f2761c5a8ad7e8ebaaad7be 100644
--- a/Source/core/dom/shadow/ElementShadow.cpp
+++ b/Source/core/dom/shadow/ElementShadow.cpp
@@ -173,7 +173,7 @@ InsertionPoint* ElementShadow::findInsertionPointFor(const Node* key) const
return m_nodeToInsertionPoint.get(key);
}
-void ElementShadow::populate(Node* node, Vector<Node*>& pool)
+void ElementShadow::populate(Node* node, Vector<Node*, 32>& pool)
{
if (!isActiveInsertionPoint(node)) {
pool.append(node);
@@ -192,16 +192,16 @@ void ElementShadow::populate(Node* node, Vector<Node*>& pool)
void ElementShadow::distribute()
{
- Vector<Node*> pool;
+ Vector<Node*, 32> pool;
for (Node* node = host()->firstChild(); node; node = node->nextSibling())
populate(node, pool);
host()->setNeedsStyleRecalc();
- Vector<bool> distributed(pool.size());
- distributed.fill(false);
+ Vector<bool> distributed;
+ distributed.fill(false, pool.size());
- Vector<HTMLShadowElement*, 8> activeShadowInsertionPoints;
+ Vector<HTMLShadowElement*, 32> activeShadowInsertionPoints;
for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) {
HTMLShadowElement* firstActiveShadowInsertionPoint = 0;
@@ -253,7 +253,7 @@ void ElementShadow::distribute()
}
}
-void ElementShadow::distributeSelectionsTo(InsertionPoint* insertionPoint, const Vector<Node*>& pool, Vector<bool>& distributed)
+void ElementShadow::distributeSelectionsTo(InsertionPoint* insertionPoint, const Vector<Node*, 32>& pool, Vector<bool>& distributed)
{
ContentDistribution distribution;
@@ -281,8 +281,9 @@ void ElementShadow::distributeNodeChildrenTo(InsertionPoint* insertionPoint, Con
InsertionPoint* innerInsertionPoint = toInsertionPoint(node);
if (innerInsertionPoint->hasDistribution()) {
for (size_t i = 0; i < innerInsertionPoint->size(); ++i) {
- distribution.append(innerInsertionPoint->at(i));
- m_nodeToInsertionPoint.add(innerInsertionPoint->at(i), insertionPoint);
+ Node* nodeToAdd = innerInsertionPoint->at(i);
+ distribution.append(nodeToAdd);
+ m_nodeToInsertionPoint.add(nodeToAdd, insertionPoint);
}
} else {
for (Node* child = innerInsertionPoint->firstChild(); child; child = child->nextSibling()) {

Powered by Google App Engine
This is Rietveld 408576698