Commit e9720c71 authored by Alex Rudenko's avatar Alex Rudenko Committed by Commit Bot

Remove DOMListener::DidRemoveDocument

Implementation for DOMListener::DidRemoveDocument was not consistent
with DOMListener::DidAddDocument implementation and it is not actually
used. This CL removes DOMListener::DidRemoveDocument for now to avoid
confusion. A proper implementation would be needed if the feature is
needed in the future.

Bug: 1128371
Change-Id: I1a48a26705547e6a86c1c0520da72c549cd66af1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416072Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Reviewed-by: default avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810328}
parent fb363ed3
...@@ -2229,8 +2229,6 @@ void InspectorCSSAgent::DidAddDocument(Document* document) { ...@@ -2229,8 +2229,6 @@ void InspectorCSSAgent::DidAddDocument(Document* document) {
StyleChangeReasonForTracing::Create(style_change_reason::kInspector)); StyleChangeReasonForTracing::Create(style_change_reason::kInspector));
} }
void InspectorCSSAgent::DidRemoveDocument(Document* document) {}
void InspectorCSSAgent::WillRemoveDOMNode(Node* node) { void InspectorCSSAgent::WillRemoveDOMNode(Node* node) {
DCHECK(node); DCHECK(node);
......
...@@ -319,7 +319,6 @@ class CORE_EXPORT InspectorCSSAgent final ...@@ -319,7 +319,6 @@ class CORE_EXPORT InspectorCSSAgent final
// InspectorDOMAgent::DOMListener implementation // InspectorDOMAgent::DOMListener implementation
void DidAddDocument(Document*) override; void DidAddDocument(Document*) override;
void DidRemoveDocument(Document*) override;
void WillRemoveDOMNode(Node*) override; void WillRemoveDOMNode(Node*) override;
void DidModifyDOMAttr(Element*) override; void DidModifyDOMAttr(Element*) override;
......
...@@ -270,11 +270,6 @@ void InspectorDOMAgent::NotifyDidAddDocument(Document* document) { ...@@ -270,11 +270,6 @@ void InspectorDOMAgent::NotifyDidAddDocument(Document* document) {
listener->DidAddDocument(document); listener->DidAddDocument(document);
} }
void InspectorDOMAgent::NotifyDidRemoveDocument(Document* document) {
for (DOMListener* listener : dom_listeners_)
listener->DidRemoveDocument(document);
}
void InspectorDOMAgent::NotifyWillRemoveDOMNode(Node* node) { void InspectorDOMAgent::NotifyWillRemoveDOMNode(Node* node) {
for (DOMListener* listener : dom_listeners_) for (DOMListener* listener : dom_listeners_)
listener->WillRemoveDOMNode(node); listener->WillRemoveDOMNode(node);
...@@ -329,9 +324,6 @@ void InspectorDOMAgent::Unbind(Node* node) { ...@@ -329,9 +324,6 @@ void InspectorDOMAgent::Unbind(Node* node) {
id_to_node_.erase(id); id_to_node_.erase(id);
id_to_nodes_map_.erase(id); id_to_nodes_map_.erase(id);
if (IsA<Document>(node))
NotifyDidRemoveDocument(To<Document>(node));
if (auto* frame_owner = DynamicTo<HTMLFrameOwnerElement>(node)) { if (auto* frame_owner = DynamicTo<HTMLFrameOwnerElement>(node)) {
Document* content_document = frame_owner->contentDocument(); Document* content_document = frame_owner->contentDocument();
if (content_document) if (content_document)
......
...@@ -75,7 +75,6 @@ class CORE_EXPORT InspectorDOMAgent final ...@@ -75,7 +75,6 @@ class CORE_EXPORT InspectorDOMAgent final
struct CORE_EXPORT DOMListener : public GarbageCollectedMixin { struct CORE_EXPORT DOMListener : public GarbageCollectedMixin {
virtual ~DOMListener() = default; virtual ~DOMListener() = default;
virtual void DidAddDocument(Document*) = 0; virtual void DidAddDocument(Document*) = 0;
virtual void DidRemoveDocument(Document*) = 0;
virtual void WillRemoveDOMNode(Node*) = 0; virtual void WillRemoveDOMNode(Node*) = 0;
virtual void DidModifyDOMAttr(Element*) = 0; virtual void DidModifyDOMAttr(Element*) = 0;
}; };
...@@ -325,7 +324,6 @@ class CORE_EXPORT InspectorDOMAgent final ...@@ -325,7 +324,6 @@ class CORE_EXPORT InspectorDOMAgent final
void EnableAndReset(); void EnableAndReset();
void NotifyDidAddDocument(Document*); void NotifyDidAddDocument(Document*);
void NotifyDidRemoveDocument(Document*);
void NotifyWillRemoveDOMNode(Node*); void NotifyWillRemoveDOMNode(Node*);
void NotifyDidModifyDOMAttr(Element*); void NotifyDidModifyDOMAttr(Element*);
......
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