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

Unified Diff: third_party/WebKit/Source/core/dom/DocumentOrderedMap.h

Issue 1532103002: Better handling of DocumentOrderedMap same-ID lookups during tree removals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review updates, part2 Created 5 years 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
Index: third_party/WebKit/Source/core/dom/DocumentOrderedMap.h
diff --git a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.h b/third_party/WebKit/Source/core/dom/DocumentOrderedMap.h
index e4c311633288140eae0884d907f5798a293950a7..0877b713598c760ce52f3e8cc0a5a2d1a707a437 100644
--- a/third_party/WebKit/Source/core/dom/DocumentOrderedMap.h
+++ b/third_party/WebKit/Source/core/dom/DocumentOrderedMap.h
@@ -44,10 +44,12 @@ namespace blink {
class Element;
class TreeScope;
-class DocumentOrderedMap : public NoBaseWillBeGarbageCollected<DocumentOrderedMap> {
+class DocumentOrderedMap : public NoBaseWillBeGarbageCollectedFinalized<DocumentOrderedMap> {
USING_FAST_MALLOC_WILL_BE_REMOVED(DocumentOrderedMap);
public:
static PassOwnPtrWillBeRawPtr<DocumentOrderedMap> create();
+ ~DocumentOrderedMap();
+
void add(const AtomicString&, Element*);
void remove(const AtomicString&, Element*);
@@ -62,7 +64,13 @@ public:
DECLARE_TRACE();
+#if ENABLE(ASSERT)
+ void willRemoveId(const AtomicString&);
+#endif
+
private:
+ DocumentOrderedMap();
+
template<bool keyMatches(const AtomicString&, const Element&)>
Element* get(const AtomicString&, const TreeScope*) const;
@@ -84,6 +92,9 @@ private:
using Map = WillBeHeapHashMap<AtomicString, OwnPtrWillBeMember<MapEntry>>;
mutable Map m_map;
+#if ENABLE(ASSERT)
+ AtomicString m_removingId;
+#endif
};
inline bool DocumentOrderedMap::contains(const AtomicString& id) const

Powered by Google App Engine
This is Rietveld 408576698