Chromium Code Reviews
DescriptionMake TreeScope::documentScope() return a reference and ensure m_documentScope is never NULL
The only big change is the removal of TreeScope::clearDocumentScope().
Now that documentScope() always returns a reference, no caller should even be
able to deal with it being null. And since we already ASSERT in ~Document and ~TreeScope
that guardRefCount is 0, there should be no one else with a reference to this TreeScope.
Thus, the call to setTreeScope(0) in ~TreeScope should be sufficient to avoid a
use-after-free of |this| as a Document.
The rest of the lines touched in this patch are just pointer -> reference conversion.
Also removed the unused default TreeScope constructor.
BUG=331922
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164586
Patch Set 1 #
Total comments: 4
Patch Set 2 : Added FIXMEs #
Messages
Total messages: 7 (0 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||