Bug 253969 - Stop including the expensive headers Document.h / LocalFrame.h in Page.h
Summary: Stop including the expensive headers Document.h / LocalFrame.h in Page.h
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-03-15 09:59 PDT by Brent Fulgham
Modified: 2023-03-15 12:13 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2023-03-15 09:59:21 PDT
The 'Page.h' header is included in many places, and pulls in Document.h and LocalFrame.h, which are costly to parse. Instead, we should forward-declare these types and limit the includes to files that actually use the implementation details.

Correct a layering violation introduced in Bug 253293 that moved the implementation of Document::page() to the Page.h header by relocating that to the existing 'DocumentInlines.h'. This should retain the performance improvement without providing an implementation in an unrelated file.

Similarly, move the inline implementation of Frame::page() that was moved into Page.h in Bug 253204 to Frame.h.

This patch adds the necessary includes that should have been added in Bugs 253293 and 253204 instead of adding the implementation in a header that happened to be commonly included.
Comment 1 Radar WebKit Bug Importer 2023-03-15 10:52:43 PDT
<rdar://problem/106762759>
Comment 2 Brent Fulgham 2023-03-15 12:13:58 PDT
Actually, after investigating this more, I think the changes in Bugs 253293 and 253204  are desirable and should be retained.