Skip to content

Commit

Permalink
Stop using CheckedPtr with CSSStyleSheet
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=266479

Reviewed by Ryosuke Niwa.

Stop using CheckedPtr with CSSStyleSheet. Use WeakPtr instead to generate more
actionable crashes. This tested as performance neutral on Speedometer 2 & 3.

* Source/WebCore/css/CSSStyleSheet.h:
* Source/WebCore/style/StyleScope.h:

Canonical link: https://commits.webkit.org/272124@main
  • Loading branch information
cdumez committed Dec 15, 2023
1 parent d6daeab commit abebb37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/WebCore/css/CSSStyleSheet.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace Style {
class Scope;
}

class CSSStyleSheet final : public StyleSheet, public CanMakeCheckedPtr {
class CSSStyleSheet final : public StyleSheet, public CanMakeSingleThreadWeakPtr<CSSStyleSheet> {
public:
struct Init {
String baseURL;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/style/StyleScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class Scope : public CanMakeWeakPtr<Scope>, public CanMakeCheckedPtr {

Timer m_pendingUpdateTimer;

mutable HashSet<CheckedRef<const CSSStyleSheet>> m_weakCopyOfActiveStyleSheetListForFastLookup;
mutable HashSet<SingleThreadWeakRef<const CSSStyleSheet>> m_weakCopyOfActiveStyleSheetListForFastLookup;

// Track the currently loading top-level stylesheets needed for rendering.
// Sheets loaded using the @import directive are not included in this count.
Expand Down

0 comments on commit abebb37

Please sign in to comment.