-
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 History.cpp #27975
Adopt more smart pointers in History.cpp #27975
Conversation
EWS run on previous version of this PR (hash 6d52e3f) |
6d52e3f
to
b7987e2
Compare
EWS run on previous version of this PR (hash b7987e2) |
b7987e2
to
9faab32
Compare
EWS run on previous version of this PR (hash 9faab32) |
9faab32
to
c8e85a2
Compare
EWS run on previous version of this PR (hash c8e85a2) |
c8e85a2
to
04d2614
Compare
EWS run on previous version of this PR (hash 04d2614) |
Source/WebCore/page/History.cpp
Outdated
return documentNotFullyActive(); | ||
|
||
auto* historyItem = frame->history().currentItem(); | ||
SUPPRESS_UNCOUNTED_LOCAL auto* historyItem = frame->history().currentItem(); |
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.
We shouldn't add SUPPRESS_UNCOUNTED_LOCAL
I think
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.
Source/WebCore/page/History.cpp
Outdated
return documentNotFullyActive(); | ||
m_lastStateObjectRequested = stateInternal(); | ||
return m_lastStateObjectRequested.get(); | ||
} | ||
|
||
SerializedScriptValue* History::stateInternal() const | ||
{ | ||
auto* frame = this->frame(); | ||
SUPPRESS_UNCOUNTED_LOCAL auto* frame = this->frame(); |
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.
ditto.
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.
Source/WebCore/page/History.cpp
Outdated
if (!frame) | ||
return nullptr; | ||
auto* historyItem = frame->history().currentItem(); | ||
SUPPRESS_UNCOUNTED_LOCAL auto* historyItem = frame->history().currentItem(); |
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.
ditto.
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.
Also removed.
Source/WebCore/page/History.cpp
Outdated
return frame->document()->url(); | ||
return frame->document()->completeURL(urlString); |
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.
I think we need to null check document (or assert) here, and protect it before invoking completeURL
.
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.
Good point! I now use protectedDocument. For urlForState I removed reffing of the frame since the (only) caller (stateObjectAdded) already has a ref to the frame.
04d2614
to
4311ea4
Compare
EWS run on previous version of this PR (hash 4311ea4) |
4311ea4
to
c1353ce
Compare
EWS run on previous version of this PR (hash c1353ce) |
Source/WebCore/page/History.cpp
Outdated
return documentNotFullyActive(); | ||
|
||
auto* historyItem = frame->history().currentItem(); | ||
RefPtr historyItem = frame->history().currentItem(); |
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.
Seems this can be simplified as:
if (RefPtr historyItem = frame->history().currentItem())
historyItem->setShouldRestoreScrollPosition(scrollRestoration == ScrollRestoration::Auto);
c1353ce
to
3ecb068
Compare
EWS run on current version of this PR (hash 3ecb068) |
https://bugs.webkit.org/show_bug.cgi?id=273541 Reviewed by Sihui Liu. Adopt more smart pointers in History.cpp based on the [alpha.webkit.UncountedLocalVarsChecker] warning. * Source/WebCore/page/History.cpp: (WebCore::History::length const): (WebCore::History::scrollRestoration const): (WebCore::History::setScrollRestoration): (WebCore::History::go): (WebCore::History::urlForState): Canonical link: https://commits.webkit.org/278310@main
3ecb068
to
cde4840
Compare
Committed 278310@main (cde4840): https://commits.webkit.org/278310@main Reviewed commits have been landed. Closing PR #27975 and removing active labels. |
cde4840
3ecb068
π§ͺ wpe-wk2π§ͺ api-iosπ§ͺ mac-AS-debug-wk2π§ͺ api-gtk