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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2779573002: Add separate trace events for recalcStyle and rebuildLayoutTree. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after
2093 clearNeedsReattachLayoutTree(); 2093 clearNeedsReattachLayoutTree();
2094 2094
2095 StyleResolver& resolver = ensureStyleResolver(); 2095 StyleResolver& resolver = ensureStyleResolver();
2096 2096
2097 bool shouldRecordStats; 2097 bool shouldRecordStats;
2098 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); 2098 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats);
2099 styleEngine().setStatsEnabled(shouldRecordStats); 2099 styleEngine().setStatsEnabled(shouldRecordStats);
2100 2100
2101 if (Element* documentElement = this->documentElement()) { 2101 if (Element* documentElement = this->documentElement()) {
2102 inheritHtmlAndBodyElementStyles(change); 2102 inheritHtmlAndBodyElementStyles(change);
2103 if (documentElement->shouldCallRecalcStyle(change)) 2103 if (documentElement->shouldCallRecalcStyle(change)) {
2104 TRACE_EVENT0("blink,blink_style", "Document::recalcStyle");
2104 documentElement->recalcStyle(change); 2105 documentElement->recalcStyle(change);
2106 }
2105 if (documentElement->needsReattachLayoutTree() || 2107 if (documentElement->needsReattachLayoutTree() ||
2106 documentElement->childNeedsReattachLayoutTree()) 2108 documentElement->childNeedsReattachLayoutTree()) {
2109 TRACE_EVENT0("blink,blink_style", "Document::rebuildLayoutTree");
2107 documentElement->rebuildLayoutTree(); 2110 documentElement->rebuildLayoutTree();
2111 }
2108 } 2112 }
2109 2113
2110 view()->recalcOverflowAfterStyleChange(); 2114 view()->recalcOverflowAfterStyleChange();
2111 2115
2112 // Only retain the HashMap for the duration of StyleRecalc and 2116 // Only retain the HashMap for the duration of StyleRecalc and
2113 // LayoutTreeConstruction. 2117 // LayoutTreeConstruction.
2114 m_nonAttachedStyle.clear(); 2118 m_nonAttachedStyle.clear();
2115 clearChildNeedsStyleRecalc(); 2119 clearChildNeedsStyleRecalc();
2116 clearChildNeedsReattachLayoutTree(); 2120 clearChildNeedsReattachLayoutTree();
2117 2121
(...skipping 4538 matching lines...) Expand 10 before | Expand all | Expand 10 after
6656 } 6660 }
6657 6661
6658 void showLiveDocumentInstances() { 6662 void showLiveDocumentInstances() {
6659 WeakDocumentSet& set = liveDocumentSet(); 6663 WeakDocumentSet& set = liveDocumentSet();
6660 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6664 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6661 for (blink::Document* document : set) 6665 for (blink::Document* document : set)
6662 fprintf(stderr, "- Document %p URL: %s\n", document, 6666 fprintf(stderr, "- Document %p URL: %s\n", document,
6663 document->url().getString().utf8().data()); 6667 document->url().getString().utf8().data());
6664 } 6668 }
6665 #endif 6669 #endif
OLDNEW
« 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