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

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

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase Created 3 years, 10 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
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 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 // We use HashMap::set over HashMap::add here as we want to 1379 // We use HashMap::set over HashMap::add here as we want to
1380 // replace the ComputedStyle but not the Node if the Node is 1380 // replace the ComputedStyle but not the Node if the Node is
1381 // already present. 1381 // already present.
1382 void Document::addStyleReattachData(const Node& node, 1382 void Document::addStyleReattachData(const Node& node,
1383 StyleReattachData& styleReattachData) { 1383 StyleReattachData& styleReattachData) {
1384 DCHECK(node.isElementNode() || node.isTextNode()); 1384 DCHECK(node.isElementNode() || node.isTextNode());
1385 m_styleReattachDataMap.set(&node, styleReattachData); 1385 m_styleReattachDataMap.set(&node, styleReattachData);
1386 } 1386 }
1387 1387
1388 StyleReattachData Document::getStyleReattachData(const Node& node) const { 1388 StyleReattachData Document::getStyleReattachData(const Node& node) const {
1389 return m_styleReattachDataMap.get(&node); 1389 return m_styleReattachDataMap.at(&node);
1390 } 1390 }
1391 1391
1392 /* 1392 /*
1393 * Performs three operations: 1393 * Performs three operations:
1394 * 1. Convert control characters to spaces 1394 * 1. Convert control characters to spaces
1395 * 2. Trim leading and trailing spaces 1395 * 2. Trim leading and trailing spaces
1396 * 3. Collapse internal whitespace. 1396 * 3. Collapse internal whitespace.
1397 */ 1397 */
1398 template <typename CharacterType> 1398 template <typename CharacterType>
1399 static inline String canonicalizedTitle(Document* document, 1399 static inline String canonicalizedTitle(Document* document,
(...skipping 5194 matching lines...) Expand 10 before | Expand all | Expand 10 after
6594 static_cast<const HTMLCollection*>(list.get())); 6594 static_cast<const HTMLCollection*>(list.get()));
6595 } else { 6595 } else {
6596 visitor->traceWrappersWithManualWriteBarrier( 6596 visitor->traceWrappersWithManualWriteBarrier(
6597 static_cast<const LiveNodeList*>(list.get())); 6597 static_cast<const LiveNodeList*>(list.get()));
6598 } 6598 }
6599 } 6599 }
6600 } 6600 }
6601 // Cannot trace in Supplementable<Document> as it is part of platform/ and 6601 // Cannot trace in Supplementable<Document> as it is part of platform/ and
6602 // thus cannot refer to ScriptWrappableVisitor. 6602 // thus cannot refer to ScriptWrappableVisitor.
6603 visitor->traceWrappers( 6603 visitor->traceWrappers(
6604 static_cast<FontFaceSet*>(Supplementable<Document>::m_supplements.get( 6604 static_cast<FontFaceSet*>(Supplementable<Document>::m_supplements.at(
6605 FontFaceSet::supplementName()))); 6605 FontFaceSet::supplementName())));
6606 ContainerNode::traceWrappers(visitor); 6606 ContainerNode::traceWrappers(visitor);
6607 } 6607 }
6608 6608
6609 template class CORE_TEMPLATE_EXPORT Supplement<Document>; 6609 template class CORE_TEMPLATE_EXPORT Supplement<Document>;
6610 6610
6611 } // namespace blink 6611 } // namespace blink
6612 6612
6613 #ifndef NDEBUG 6613 #ifndef NDEBUG
6614 static WeakDocumentSet& liveDocumentSet() { 6614 static WeakDocumentSet& liveDocumentSet() {
6615 DEFINE_STATIC_LOCAL(WeakDocumentSet, set, ()); 6615 DEFINE_STATIC_LOCAL(WeakDocumentSet, set, ());
6616 return set; 6616 return set;
6617 } 6617 }
6618 6618
6619 void showLiveDocumentInstances() { 6619 void showLiveDocumentInstances() {
6620 WeakDocumentSet& set = liveDocumentSet(); 6620 WeakDocumentSet& set = liveDocumentSet();
6621 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6621 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6622 for (blink::Document* document : set) 6622 for (blink::Document* document : set)
6623 fprintf(stderr, "- Document %p URL: %s\n", document, 6623 fprintf(stderr, "- Document %p URL: %s\n", document,
6624 document->url().getString().utf8().data()); 6624 document->url().getString().utf8().data());
6625 } 6625 }
6626 #endif 6626 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698