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

Unified Diff: third_party/WebKit/Source/core/css/CSSSelectorList.cpp

Issue 1569483002: [FastMalloc]: Annotate CSSSelector for heap profiling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Line wrap comment at 80 columns Created 4 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSSelectorList.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSSelectorList.cpp b/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
index 351d39845ab6809b09486c76d86947f3dd1ff562..114fb8460e58dd0739288b723d1235976e1d1985 100644
--- a/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
+++ b/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
@@ -30,6 +30,14 @@
#include "wtf/Partitions.h"
#include "wtf/text/StringBuilder.h"
+namespace {
+ // CSSSelector is one of the top types that consume renderer memory,
+ // so instead of using the |WTF_HEAP_PROFILER_TYPE_NAME| macro in the
+ // allocations below, pass this type name constant to allow profiling
+ // in official builds.
+ const char kCSSSelectorTypeName[] = "blink::CSSSelector";
+}
+
namespace blink {
CSSSelectorList CSSSelectorList::copy() const
@@ -37,7 +45,7 @@ CSSSelectorList CSSSelectorList::copy() const
CSSSelectorList list;
unsigned length = this->length();
- list.m_selectorArray = reinterpret_cast<CSSSelector*>(WTF::Partitions::fastMalloc(sizeof(CSSSelector) * length, WTF_HEAP_PROFILER_TYPE_NAME(CSSSelector)));
+ list.m_selectorArray = reinterpret_cast<CSSSelector*>(WTF::Partitions::fastMalloc(sizeof(CSSSelector) * length, kCSSSelectorTypeName));
for (unsigned i = 0; i < length; ++i)
new (&list.m_selectorArray[i]) CSSSelector(m_selectorArray[i]);
@@ -54,7 +62,7 @@ CSSSelectorList CSSSelectorList::adoptSelectorVector(Vector<OwnPtr<CSSParserSele
ASSERT(flattenedSize);
CSSSelectorList list;
- list.m_selectorArray = reinterpret_cast<CSSSelector*>(WTF::Partitions::fastMalloc(sizeof(CSSSelector) * flattenedSize, WTF_HEAP_PROFILER_TYPE_NAME(CSSSelector)));
+ list.m_selectorArray = reinterpret_cast<CSSSelector*>(WTF::Partitions::fastMalloc(sizeof(CSSSelector) * flattenedSize, kCSSSelectorTypeName));
size_t arrayIndex = 0;
for (size_t i = 0; i < selectorVector.size(); ++i) {
CSSParserSelector* current = selectorVector[i].get();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698