summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 12:02:56 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 12:02:56 +0000
commit5ad88e29ea12efc669e457471e11e6bf3c4e8faa (patch)
tree0d040b4137d19e1a5f9d8077387e395ec0cd5427 /webkit
parent4ea6ee7c953b771ebedf1a319db4107debaf16ab (diff)
downloadchromium_src-5ad88e29ea12efc669e457471e11e6bf3c4e8faa.zip
chromium_src-5ad88e29ea12efc669e457471e11e6bf3c4e8faa.tar.gz
chromium_src-5ad88e29ea12efc669e457471e11e6bf3c4e8faa.tar.bz2
DevTools: Do not crash on document-less HTMLFrameOwnerElement removal from DOM while inspecting.
BUG=13996 Review URL: http://codereview.chromium.org/126269 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/devtools/dom_agent_impl.cc6
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,