Skip to content

[GLib] Make WebKitSettings XSS auditor functions no-op - #389

Merged
webkit-early-warning-system merged 0 commit into
WebKit:mainfrom
mcatanzaro:eng/xss-auditor
Apr 27, 2022
Merged

webkit-early-warning-system merged 0 commit into
WebKit:mainfrom
mcatanzaro:eng/xss-auditor

Conversation

@mcatanzaro

@mcatanzaro mcatanzaro commented Apr 26, 2022 •

Copy link
Copy Markdown
Contributor

3d19e33

[GLib] Make WebKitSettings XSS auditor functions no-op
https://bugs.webkit.org/show_bug.cgi?id=239651

Patch by Michael Catanzaro <[email protected] > on 2022-04-27
Reviewed by Adrian Perez de Castro.

Let's deprecate these functions.

Also, do not print warnings because they are called during init by the property setters.

* Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_get_enable_xss_auditor):
(webkit_settings_set_enable_xss_auditor):
* Source/WebKit/UIProcess/API/gtk/WebKitSettings.h:
* Source/WebKit/UIProcess/API/wpe/WebKitSettings.h:

Canonical link: https://commits.webkit.org/250038@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293507 268f45cc-cd09-0410-ab3c-d52691b4dbfc

@mcatanzaro mcatanzaro added the merge-queue Applied to send a pull request to merge-queue label Apr 27, 2022
@webkit-early-warning-system
webkit-early-warning-system merged commit 3d19e33 into WebKit:main Apr 27, 2022
@webkit-early-warning-system

Copy link
Copy Markdown
Collaborator

Committed r293507 (250038@main): https://commits.webkit.org/250038@main

Reviewed commits have been landed. Closing PR #389 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system removed the merge-queue Applied to send a pull request to merge-queue label Apr 27, 2022
@mcatanzaro
mcatanzaro deleted the eng/xss-auditor branch July 7, 2022 01:03
webkit-commit-queue pushed a commit that referenced this pull request Oct 4, 2025
rdar://161694748
https://bugs.webkit.org/show_bug.cgi?id=299920

Reviewed by Ryosuke Niwa.

Prior to this patch, DocumentInlines.h was the most expensive header used in
WebCore; it is included 303 times in a WebCore Unified build, and on this
machine, each include of that file too the compile on average 1.5s to parse, for
a total of 8m CPU minutes of time spent parsing this header.

To diagnose why this header is so expensive, I commented out all the
implementations from the body of this header and ran a compile, collecting a
list of all the errors encountered. I then collected the counts of each error
message, and grouped liked errors together. It became clear that most uses of
DocumentInlines.h were to pull in a very narrow set of inlined methods, but
to get those few methods had to include a very large and very heavy header.

To address this, DocumentInlines.h was broken up into separate headers, each
which includes only Document.h and one or two other headers. Usually the second
header was required to define the return type of the method, and the type
definition is required because the return type is a CheckedPtr or RefPtr.
However because the return value is typically used at the call site, that return
value header would have been included already, meaning this style of header has
zero effective additional cost.

The files were created in descending order of the number of uses:
- DocumentView.h - 187
- DocumentPage.h - 175
- DocumentQuirks.h - 84
- DocumentSecurityOrigin.h - 54
- DocumentResourceLoader.h - 49
- DocumentMarkers.h - 27
- DocumentEventLoop.h - 26
- DocumentSettingsValues.h - 23
- DocumentWindow.h - 19

The remaining grab-bag of inlined methods had less than 10 uses each and were
left in DocumentInlines.h.

After this patch, DocumentInlines.h is used in just over 100 implementation
files and no headers. None of the new Document*.h headers or DocumentInlines.h
appear in the top 100 most expensive header files. DocumentInlines.h dropped
from the #1 most expensive header taking 8m to parse to #389 and 5.7s of
parsing. The most expensive new header is DocumentPage.h at #124 and 25s of
parsing.

Canonical link: https://commits.webkit.org/300989@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants