[webkit-changes] [WebKit/WebKit] 319370: transientRegistry should be WeakHashSet instead of...

Ryosuke Niwa noreply at github.com
Thu Feb 2 19:29:38 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 319370e5b8a1247588b43f7859ce26a06214ecf3
      https://github.com/WebKit/WebKit/commit/319370e5b8a1247588b43f7859ce26a06214ecf3
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2023-02-02 (Thu, 02 Feb 2023)

  Changed paths:
    M Source/WTF/wtf/WeakHashMap.h
    M Source/WTF/wtf/WeakHashSet.h
    M Source/WTF/wtf/WeakListHashSet.h
    M Source/WTF/wtf/WeakPtr.h
    M Source/WebCore/dom/Node.cpp
    M Source/WebCore/dom/Node.h
    M Source/WebCore/dom/NodeRareData.h

  Log Message:
  -----------
  transientRegistry should be WeakHashSet instead of HashSet of raw pointers
https://bugs.webkit.org/show_bug.cgi?id=251609

Reviewed by Chris Dumez.

Deploy WeakHashSet to NodeMutationObserverData::transientRegistry.

* Source/WTF/wtf/WeakHashMap.h:
* Source/WTF/wtf/WeakHashSet.h:
* Source/WTF/wtf/WeakListHashSet.h:
* Source/WTF/wtf/WeakPtr.h: Forward declare all Weak* container types.

* Source/WebCore/dom/Node.cpp:
(WebCore::Node::clearRareData):
(WebCore::Node::moveNodeToNewDocument):
(WebCore::Node::mutationObserverRegistry):
(WebCore::Node::transientMutationObserverRegistry):
(WebCore::collectMatchingObserversForMutation): Deleted.
(WebCore::Node::registeredMutationObservers): Refactored this code now that we can't share
a template function between mutationObserverRegistry and transientMutationObserverRegistry.
(WebCore::Node::registerMutationObserver):
(WebCore::Node::registerTransientMutationObserver):
(WebCore::Node::unregisterTransientMutationObserver):
(WebCore::Node::notifyMutationObserversNodeWillDetach):
* Source/WebCore/dom/Node.h:
* Source/WebCore/dom/NodeRareData.h:
(WebCore::NodeRareData::mutationObserverDataIfExists): Renamed from mutationObserverData.
(WebCore::NodeRareData::mutationObserverData): Renamed from ensureMutationObserverData.

Canonical link: https://commits.webkit.org/259793@main




More information about the webkit-changes mailing list