WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
237565
REGRESSION (
r290853
): CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::FrameLoader::clear
https://bugs.webkit.org/show_bug.cgi?id=237565
Summary
REGRESSION (r290853): CrashTracer: com.apple.WebKit.WebContent.Development at...
Kate Cheney
Reported
2022-03-07 16:19:17 PST
REGRESSION (
r290853
): CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::FrameLoader::clear
Attachments
Patch
(2.44 KB, patch)
2022-03-07 16:24 PST
,
Kate Cheney
no flags
Details
Formatted Diff
Diff
Patch
(2.86 KB, patch)
2022-03-07 18:18 PST
,
Kate Cheney
no flags
Details
Formatted Diff
Diff
Patch
(2.86 KB, patch)
2022-03-08 06:45 PST
,
Kate Cheney
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Kate Cheney
Comment 1
2022-03-07 16:24:36 PST
Created
attachment 454048
[details]
Patch
David Kilzer (:ddkilzer)
Comment 2
2022-03-07 16:43:15 PST
Comment on
attachment 454048
[details]
Patch r=me, but might want an expert in FrameLoader code to review this as well.
David Kilzer (:ddkilzer)
Comment 3
2022-03-07 16:44:20 PST
<
rdar://89923867
>
Chris Dumez
Comment 4
2022-03-07 16:58:41 PST
Comment on
attachment 454048
[details]
Patch I feel it would have been less risky to change the parameter to use a RefPtr<Document>&& instead of a Document*.
Kate Cheney
Comment 5
2022-03-07 18:18:45 PST
Created
attachment 454057
[details]
Patch
Chris Dumez
Comment 6
2022-03-07 18:22:38 PST
Comment on
attachment 454057
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=454057&action=review
> Source/WebCore/loader/FrameLoader.cpp:623 > +void FrameLoader::clear(RefPtr<Document> newDocument, bool clearWindowProperties, bool clearScriptObjects, bool clearFrameView, Function<void()>&& handleDOMWindowCreation)
We should avoid passing parameters my values as much as possible. As suggested on Slack, I think this should be a Ref<Document>&&.
> Source/WebCore/loader/FrameLoader.h:155 > + void clear(RefPtr<Document> newDocument, bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true, Function<void()>&& handleDOMWindowCreation = nullptr);
ditto.
Chris Dumez
Comment 7
2022-03-07 18:29:54 PST
(In reply to Chris Dumez from
comment #6
)
> Comment on
attachment 454057
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=454057&action=review
> > > Source/WebCore/loader/FrameLoader.cpp:623 > > +void FrameLoader::clear(RefPtr<Document> newDocument, bool clearWindowProperties, bool clearScriptObjects, bool clearFrameView, Function<void()>&& handleDOMWindowCreation) > > We should avoid passing parameters my values as much as possible. As > suggested on Slack, I think this should be a Ref<Document>&&. > > > Source/WebCore/loader/FrameLoader.h:155 > > + void clear(RefPtr<Document> newDocument, bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true, Function<void()>&& handleDOMWindowCreation = nullptr); > > ditto.
I looked at the call sites, it doesn't look like any can be updated to "move" the RefPtr in and avoid ref-counting churn. That said, I still think it is good practice to take in a Ref<Document>&& as it could potentially be leveraged in the future and there is no cost/drawback.
Chris Dumez
Comment 8
2022-03-07 19:10:13 PST
Comment on
attachment 454057
[details]
Patch r=me with the change to Ref<>&&
Kate Cheney
Comment 9
2022-03-08 06:41:57 PST
(In reply to Chris Dumez from
comment #7
)
> (In reply to Chris Dumez from
comment #6
) > > Comment on
attachment 454057
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=454057&action=review
> > > > > Source/WebCore/loader/FrameLoader.cpp:623 > > > +void FrameLoader::clear(RefPtr<Document> newDocument, bool clearWindowProperties, bool clearScriptObjects, bool clearFrameView, Function<void()>&& handleDOMWindowCreation) > > > > We should avoid passing parameters my values as much as possible. As > > suggested on Slack, I think this should be a Ref<Document>&&. > > > > > Source/WebCore/loader/FrameLoader.h:155 > > > + void clear(RefPtr<Document> newDocument, bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true, Function<void()>&& handleDOMWindowCreation = nullptr); > > > > ditto. > > I looked at the call sites, it doesn't look like any can be updated to > "move" the RefPtr in and avoid ref-counting churn. That said, I still think > it is good practice to take in a Ref<Document>&& as it could potentially be > leveraged in the future and there is no cost/drawback.
Ah ok, that's why I ended up not using && but you're right about future leveraging.
Kate Cheney
Comment 10
2022-03-08 06:43:35 PST
(In reply to Chris Dumez from
comment #6
)
> Comment on
attachment 454057
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=454057&action=review
> > > Source/WebCore/loader/FrameLoader.cpp:623 > > +void FrameLoader::clear(RefPtr<Document> newDocument, bool clearWindowProperties, bool clearScriptObjects, bool clearFrameView, Function<void()>&& handleDOMWindowCreation) > > We should avoid passing parameters my values as much as possible. As > suggested on Slack, I think this should be a Ref<Document>&&. >
Assuming you mean RefPtr<Document>&&
Kate Cheney
Comment 11
2022-03-08 06:45:10 PST
Created
attachment 454116
[details]
Patch
Chris Dumez
Comment 12
2022-03-08 07:07:55 PST
(In reply to Kate Cheney from
comment #10
)
> (In reply to Chris Dumez from
comment #6
) > > Comment on
attachment 454057
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=454057&action=review
> > > > > Source/WebCore/loader/FrameLoader.cpp:623 > > > +void FrameLoader::clear(RefPtr<Document> newDocument, bool clearWindowProperties, bool clearScriptObjects, bool clearFrameView, Function<void()>&& handleDOMWindowCreation) > > > > We should avoid passing parameters my values as much as possible. As > > suggested on Slack, I think this should be a Ref<Document>&&. > > > > Assuming you mean RefPtr<Document>&&
Totally :)
EWS
Comment 13
2022-03-08 08:57:24 PST
Committed
r290994
(
248172@main
): <
https://commits.webkit.org/248172@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 454116
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug