[webkit-reviews] review granted: [Bug 127786] Document::topDocument() should return a reference : [Attachment 222473] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 28 12:19:09 PST 2014


Darin Adler <darin at apple.com> has granted Antti Koivisto <koivisto at iki.fi>'s
request for review:
Bug 127786: Document::topDocument() should return a reference
https://bugs.webkit.org/show_bug.cgi?id=127786

Attachment 222473: patch
https://bugs.webkit.org/attachment.cgi?id=222473&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=222473&action=review


> Source/WebCore/dom/Document.cpp:4316
> -    return m_frame ? m_frame->mainFrame().document() :
const_cast<Document*>(this);
> +    return m_frame ? *m_frame->mainFrame().document() :
const_cast<Document&>(*this);

We should make this 100% safe by null-checking MainFrame::document and falling
back to this in that case too. And if we ever change MainFrame::document to
return a reference we can delete that branch.


More information about the webkit-reviews mailing list