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

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

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase 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
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 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 } 1905 }
1906 1906
1907 using EventTargetDataMap = 1907 using EventTargetDataMap =
1908 PersistentHeapHashMap<WeakMember<Node>, Member<EventTargetData>>; 1908 PersistentHeapHashMap<WeakMember<Node>, Member<EventTargetData>>;
1909 static EventTargetDataMap& eventTargetDataMap() { 1909 static EventTargetDataMap& eventTargetDataMap() {
1910 DEFINE_STATIC_LOCAL(EventTargetDataMap, map, ()); 1910 DEFINE_STATIC_LOCAL(EventTargetDataMap, map, ());
1911 return map; 1911 return map;
1912 } 1912 }
1913 1913
1914 EventTargetData* Node::eventTargetData() { 1914 EventTargetData* Node::eventTargetData() {
1915 return hasEventTargetData() ? eventTargetDataMap().get(this) : nullptr; 1915 return hasEventTargetData() ? eventTargetDataMap().at(this) : nullptr;
1916 } 1916 }
1917 1917
1918 EventTargetData& Node::ensureEventTargetData() { 1918 EventTargetData& Node::ensureEventTargetData() {
1919 if (hasEventTargetData()) 1919 if (hasEventTargetData())
1920 return *eventTargetDataMap().get(this); 1920 return *eventTargetDataMap().at(this);
1921 DCHECK(!eventTargetDataMap().contains(this)); 1921 DCHECK(!eventTargetDataMap().contains(this));
1922 setHasEventTargetData(true); 1922 setHasEventTargetData(true);
1923 EventTargetData* data = new EventTargetData; 1923 EventTargetData* data = new EventTargetData;
1924 eventTargetDataMap().set(this, data); 1924 eventTargetDataMap().set(this, data);
1925 return *data; 1925 return *data;
1926 } 1926 }
1927 1927
1928 const HeapVector<TraceWrapperMember<MutationObserverRegistration>>* 1928 const HeapVector<TraceWrapperMember<MutationObserverRegistration>>*
1929 Node::mutationObserverRegistry() { 1929 Node::mutationObserverRegistry() {
1930 if (!hasRareData()) 1930 if (!hasRareData())
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
2567 if (node) { 2567 if (node) {
2568 std::stringstream stream; 2568 std::stringstream stream;
2569 node->printNodePathTo(stream); 2569 node->printNodePathTo(stream);
2570 LOG(INFO) << stream.str(); 2570 LOG(INFO) << stream.str();
2571 } else { 2571 } else {
2572 LOG(INFO) << "Cannot showNodePath for <null>"; 2572 LOG(INFO) << "Cannot showNodePath for <null>";
2573 } 2573 }
2574 } 2574 }
2575 2575
2576 #endif 2576 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698