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

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

Issue 2405753002: Removed ref churn from Document::getNonAttachedStyle. (Closed)
Patch Set: Created 4 years, 2 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 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 1248
1249 // We use HashMap::set over HashMap::add here as we want to 1249 // We use HashMap::set over HashMap::add here as we want to
1250 // replace the ComputedStyle but not the Element if the Element is 1250 // replace the ComputedStyle but not the Element if the Element is
1251 // already present. 1251 // already present.
1252 void Document::addNonAttachedStyle(Element& element, 1252 void Document::addNonAttachedStyle(Element& element,
1253 RefPtr<ComputedStyle> computedStyle) { 1253 RefPtr<ComputedStyle> computedStyle) {
1254 m_nonAttachedStyle.set(&element, computedStyle); 1254 m_nonAttachedStyle.set(&element, computedStyle);
1255 } 1255 }
1256 1256
1257 ComputedStyle* Document::getNonAttachedStyle(Element& element) { 1257 ComputedStyle* Document::getNonAttachedStyle(Element& element) {
1258 RefPtr<ComputedStyle> style = m_nonAttachedStyle.get(&element); 1258 return m_nonAttachedStyle.get(&element);
1259 return style.get();
1260 } 1259 }
1261 1260
1262 /* 1261 /*
1263 * Performs three operations: 1262 * Performs three operations:
1264 * 1. Convert control characters to spaces 1263 * 1. Convert control characters to spaces
1265 * 2. Trim leading and trailing spaces 1264 * 2. Trim leading and trailing spaces
1266 * 3. Collapse internal whitespace. 1265 * 3. Collapse internal whitespace.
1267 */ 1266 */
1268 template <typename CharacterType> 1267 template <typename CharacterType>
1269 static inline String canonicalizedTitle(Document* document, 1268 static inline String canonicalizedTitle(Document* document,
(...skipping 5132 matching lines...) Expand 10 before | Expand all | Expand 10 after
6402 } 6401 }
6403 6402
6404 void showLiveDocumentInstances() { 6403 void showLiveDocumentInstances() {
6405 WeakDocumentSet& set = liveDocumentSet(); 6404 WeakDocumentSet& set = liveDocumentSet();
6406 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6405 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6407 for (Document* document : set) 6406 for (Document* document : set)
6408 fprintf(stderr, "- Document %p URL: %s\n", document, 6407 fprintf(stderr, "- Document %p URL: %s\n", document,
6409 document->url().getString().utf8().data()); 6408 document->url().getString().utf8().data());
6410 } 6409 }
6411 #endif 6410 #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