mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-16 20:20:51 +01:00
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())
|
if (!VerifyContext())
|
||||||
return;
|
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()) {
|
if (!node_map_.empty()) {
|
||||||
NodeMap::const_iterator it = node_map_.begin();
|
NodeMap::const_iterator it = node_map_.begin();
|
||||||
for (; it != node_map_.end(); ++it)
|
for (; it != node_map_.end(); ++it)
|
||||||
|
@ -147,6 +147,10 @@ CefRefPtr<CefDOMNode> CefDOMEventImpl::GetCurrentTarget()
|
|||||||
|
|
||||||
void CefDOMEventImpl::Detach()
|
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;
|
document_ = NULL;
|
||||||
event_.assign(WebDOMEvent());
|
event_.assign(WebDOMEvent());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user