-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adopt more smart pointers in LocalFrame #27870
Adopt more smart pointers in LocalFrame #27870
Conversation
EWS run on previous version of this PR (hash 20dd3ba) |
@@ -134,23 +134,23 @@ DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); | |||
|
|||
static inline float parentPageZoomFactor(LocalFrame* frame) | |||
{ | |||
LocalFrame* parent = dynamicDowncast<LocalFrame>(frame->tree().parent()); | |||
RefPtr parent = dynamicDowncast<LocalFrame>(frame->tree().parent()); | |||
if (!parent) | |||
return 1; | |||
return parent->pageZoomFactor(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a trivial inline function, no? So why are we doing smart pointer adoption here? Please follow the guidelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, indeed I did not check for trivial inline functions. Fixed this one now and went over all other changes to check for this.
20dd3ba
to
15d06f8
Compare
EWS run on previous version of this PR (hash 15d06f8) |
Source/WebCore/page/LocalFrame.cpp
Outdated
|
||
if (auto* window = JSDOMWindow::toWrapped(vm, value)) | ||
if (RefPtr window = JSDOMWindow::toWrapped(vm, value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the local variable vm is unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the local variable.
15d06f8
to
881201e
Compare
EWS run on current version of this PR (hash 881201e) |
https://bugs.webkit.org/show_bug.cgi?id=273397 Reviewed by Sihui Liu. Adopt more smart pointers in LocalFrame based on the [alpha.webkit.UncountedLocalVarsChecker] warning. * Source/WebCore/page/LocalFrame.cpp: (WebCore::parentPageZoomFactor): (WebCore::parentTextZoomFactor): (WebCore::rootFrame): (WebCore::LocalFrame::LocalFrame): (WebCore::LocalFrame::~LocalFrame): (WebCore::LocalFrame::shouldUsePrintingLayout const): (WebCore::LocalFrame::frameForWidget): (WebCore::LocalFrame::rangeForPoint): (WebCore::LocalFrame::debugDescription const): (WebCore::LocalFrame::contentFrameFromWindowOrFrameElement): Canonical link: https://commits.webkit.org/278206@main
881201e
to
088a3e5
Compare
Committed 278206@main (088a3e5): https://commits.webkit.org/278206@main Reviewed commits have been landed. Closing PR #27870 and removing active labels. |
088a3e5
881201e