Skip to content

Commit

Permalink
Add a script to count places we skip code on site isolated frames
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265558
rdar://118958958

Reviewed by Alex Christensen.

This probably isn't comprehensive, and some of these may not need fixing, but it provides a rough estimate
we can use to track our progress.

Similar to `count-handwritten-cocoa-decoders`.

* Tools/Scripts/count-skipped-out-of-process-frames: Added.

Canonical link: https://commits.webkit.org/271316@main
  • Loading branch information
charliewolfe committed Nov 30, 2023
1 parent 48c1a4c commit 6f33b37
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Tools/Scripts/count-skipped-out-of-process-frames
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
#
# This script scans Source/WebCore and Source/WebKit/WebProcess for places where we are likely skipping code on out-of-process frames and provides a count.
#

count_occurrences() {
local pattern=$1
local flag=$2
grep "$flag" "$pattern" "$(dirname "$0")/../../Source/WebCore" "$(dirname "$0")/../../Source/WebKit/WebProcess" | wc -l | xargs
}

downcastLocalFrame=$(count_occurrences "[dD]owncast<\(WebCore::\)\?LocalFrame>" "-r")
downcastLocalFrameView=$(count_occurrences "[dD]owncast<\(WebCore::\)\?LocalFrameView>" "-r")
topDocument=$(count_occurrences "topDocument()" "-r")
parentDocument=$(count_occurrences "parentDocument()" "-r")

echo "Downcast LocalFrame remaining: $downcastLocalFrame"
echo "Downcast LocalFrameView remaining: $downcastLocalFrameView"
echo "topDocument() remaining: $topDocument"
echo "parentDocument() remaining: $parentDocument"

sum=$((downcastLocalFrame + downcastLocalFrameView + topDocument + parentDocument))
echo "Total skipped out-of-process frames remaining: $sum"

0 comments on commit 6f33b37

Please sign in to comment.