Conversion from: WebKit technology translation series (1): main objects in WebCore
Original link http://webkit.org/coding/major-objects.html
WebCore uses many objects to represent the web pages in memory. This article describes some of the main objects and their relationships. In some cases, the connection between objects is broken, resulting in NULL pointer reference. Therefore, when traversing these pointers, the Code must carefully consider the "detached" Situation and elegantly process the NULL pointer.
+---------+ | Chrome | +----+----+ | +---+---+ +----------+ | Page +---->| Settings | +---+---+ +----------+ | +-------------------------- ... other Frame objects | +---+---+ +-------------+ +-------------------+ | Frame +---+ FrameLoader + | JSDOMWindowShell | +---+---+ +-------------+ +---------+---------+ / / | / / // Re-used after navigation // |.../....|...............................................|.......... / | // Replaced after navigation // | / | |/<------|<-- Ptrs to Frame are null after navigation[1] || | || +-----+-----+ +-------------+ || | DOMWindow |<--impl--+ JSDOMWindow |<------window----+| +-----+-----+ +-------------+| || |<-- Can be null for Documents created by XMLHttpRequest| || +-----+-----+ +-------------++-+ Document |<--impl--+ JSDocument | +-----+-----+ +-------------+ | |<-- Can be null for DocumentType objects | +---+---+ +--------+ | Node |<---impl---| JSNode | +-------+ +--------+
[1] After navigating to a new page, the old domwindow and document point to an empty frame, while the frame points to a new domwindow and document.