Commit 20565b78 authored by esprehn@chromium.org's avatar esprehn@chromium.org

Remove NodeRemovalDispatcher

Since we don't have the SVGInstance tree anymore we can get rid of this
template dispatcher.

Review URL: https://codereview.chromium.org/323253002

git-svn-id: svn://svn.chromium.org/blink/trunk@175984 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 5387cc67
...@@ -69,34 +69,6 @@ inline void removeDetachedChildrenInContainer(GenericNodeContainer& container) ...@@ -69,34 +69,6 @@ inline void removeDetachedChildrenInContainer(GenericNodeContainer& container)
// Helper methods for removeDetachedChildrenInContainer, hidden from WebCore namespace // Helper methods for removeDetachedChildrenInContainer, hidden from WebCore namespace
namespace Private { namespace Private {
template<class GenericNode, class GenericNodeContainer, bool dispatchRemovalNotification>
struct NodeRemovalDispatcher {
static void dispatch(GenericNode&, GenericNodeContainer&)
{
// no-op, by default
}
};
template<class GenericNode, class GenericNodeContainer>
struct NodeRemovalDispatcher<GenericNode, GenericNodeContainer, true> {
static void dispatch(GenericNode& node, GenericNodeContainer& container)
{
container.document().adoptIfNeeded(node);
if (node.inDocument())
container.notifyNodeRemoved(node);
}
};
template<class GenericNode>
struct ShouldDispatchRemovalNotification {
static const bool value = false;
};
template<>
struct ShouldDispatchRemovalNotification<Node> {
static const bool value = true;
};
template<class GenericNode, class GenericNodeContainer> template<class GenericNode, class GenericNodeContainer>
void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, GenericNodeContainer& container) void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, GenericNodeContainer& container)
{ {
...@@ -126,7 +98,9 @@ namespace Private { ...@@ -126,7 +98,9 @@ namespace Private {
tail = n; tail = n;
} else { } else {
RefPtrWillBeRawPtr<GenericNode> protect(n); // removedFromDocument may remove all references to this node. RefPtrWillBeRawPtr<GenericNode> protect(n); // removedFromDocument may remove all references to this node.
NodeRemovalDispatcher<GenericNode, GenericNodeContainer, ShouldDispatchRemovalNotification<GenericNode>::value>::dispatch(*n, container); container.document().adoptIfNeeded(*n);
if (n->inDocument())
container.notifyNodeRemoved(*n);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment