走进WebKit——打开新Tab(一)
基于 Safari
在 WebKit2 中
打开一个新的Tab,首先调用的
void DocumentWriter::end(){ ASSERT(m_frame->page()); ASSERT(m_frame->document()); // The parser is guaranteed to be released after this point. begin() would // have to be called again before we can start writing more data. m_state = FinishedWritingState; // http://bugs.webkit.org/show_bug.cgi?id=10854 // The frame's last ref may be removed and it can be deleted by checkCompleted(), // so we'll add a protective refcount RefPtr<Frame> protector(m_frame); if (!m_parser) return; // FIXME: m_parser->finish() should imply m_parser->flush(). m_parser->flush(this); if (!m_parser) return; m_parser->finish(); m_parser = 0;}