diff options
Diffstat (limited to 'webkit/glue/devtools/dom_agent_impl.cc')
-rw-r--r-- | webkit/glue/devtools/dom_agent_impl.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/webkit/glue/devtools/dom_agent_impl.cc b/webkit/glue/devtools/dom_agent_impl.cc index d8d6ea5..de3c0b7 100644 --- a/webkit/glue/devtools/dom_agent_impl.cc +++ b/webkit/glue/devtools/dom_agent_impl.cc @@ -93,8 +93,9 @@ void DomAgentImpl::SetDocument(Document* doc) { } void DomAgentImpl::StartListening(Document* doc) { - if (documents_.contains(doc)) + if (documents_.contains(doc)) { return; + } doc->addEventListener(eventNames().DOMContentLoadedEvent, event_listener_, false); doc->addEventListener(eventNames().DOMNodeInsertedEvent, event_listener_, @@ -109,6 +110,9 @@ void DomAgentImpl::StartListening(Document* doc) { } void DomAgentImpl::StopListening(Document* doc) { + if (!documents_.contains(doc)) { + return; + } doc->removeEventListener(eventNames().DOMContentLoadedEvent, event_listener_.get(), false); doc->removeEventListener(eventNames().DOMNodeInsertedEvent, |