Add asserts to verify correct DOM object usage.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@192 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
60736ac4e0
commit
6ca5cff06c
|
@ -255,6 +255,14 @@ void CefDOMDocumentImpl::Detach()
|
|||
if (!VerifyContext())
|
||||
return;
|
||||
|
||||
// If you hit this assert it means that you are keeping references to node
|
||||
// objects beyond the valid scope.
|
||||
DCHECK(node_map_.empty());
|
||||
|
||||
// If you hit this assert it means that you are keeping references to this
|
||||
// document object beyond the valid scope.
|
||||
DCHECK(GetRefCt() == 1);
|
||||
|
||||
if (!node_map_.empty()) {
|
||||
NodeMap::const_iterator it = node_map_.begin();
|
||||
for (; it != node_map_.end(); ++it)
|
||||
|
|
|
@ -147,6 +147,10 @@ CefRefPtr<CefDOMNode> CefDOMEventImpl::GetCurrentTarget()
|
|||
|
||||
void CefDOMEventImpl::Detach()
|
||||
{
|
||||
// If you hit this assert it means that you are keeping references to this
|
||||
// event object beyond the valid scope.
|
||||
DCHECK(GetRefCt() == 1);
|
||||
|
||||
document_ = NULL;
|
||||
event_.assign(WebDOMEvent());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue