Skip to content

[IsDeprecatedWeakRefSmartPointerException] Make PageLoadState and related classes RefCounted or equivalent#34183

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
basuke:eng/280282
Sep 27, 2024
Merged

[IsDeprecatedWeakRefSmartPointerException] Make PageLoadState and related classes RefCounted or equivalent#34183
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
basuke:eng/280282

Conversation

@basuke
Copy link
Copy Markdown
Contributor

@basuke basuke commented Sep 24, 2024

0eadc69

[IsDeprecatedWeakRefSmartPointerException] Make PageLoadState and related classes RefCounted or equivalent
https://bugs.webkit.org/show_bug.cgi?id=280282

Reviewed by Chris Dumez.

Those classes are CanMakeWeakPtr so that need to be lifecycle manageable.

* Source/WebKit/UIProcess/API/C/WKPage.cpp:
(WKPageSetPageStateClient):
* Source/WebKit/UIProcess/API/C/mac/WKPagePrivateMac.mm:
(-[WKObservablePageState initWithPage:]):
* Source/WebKit/UIProcess/API/Cocoa/PageLoadStateObserver.h:
* Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController _initWithPageRef:]):
(WebKit::PageLoadStateObserver::ref const):
(WebKit::PageLoadStateObserver::deref const):
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewConstructed):
(webkitWebViewDispose):
* Source/WebKit/UIProcess/Cocoa/NavigationState.h:
* Source/WebKit/UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::ref const):
(WebKit::NavigationState::deref const):
* Source/WebKit/UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::callObserverCallback):
* Source/WebKit/UIProcess/PageLoadState.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setPageLoadStateObserver):
* Source/WebKit/UIProcess/WebPageProxy.h:

Canonical link: https://commits.webkit.org/284380@main

e3e7f0a

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@basuke basuke self-assigned this Sep 24, 2024
@basuke basuke added the WebKit2 Bugs relating to the WebKit2 API layer label Sep 24, 2024
@basuke basuke marked this pull request as ready for review September 24, 2024 20:46
@basuke basuke requested review from a team and cdumez as code owners September 24, 2024 20:46
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 24, 2024
@basuke basuke removed the merging-blocked Applied to prevent a change from being merged label Sep 24, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 25, 2024
@basuke basuke marked this pull request as draft September 25, 2024 16:35
@basuke basuke removed the merging-blocked Applied to prevent a change from being merged label Sep 25, 2024
Comment thread Source/WebKit/UIProcess/Cocoa/NavigationState.h Outdated
Comment thread Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp Outdated
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 25, 2024
@basuke basuke removed the merging-blocked Applied to prevent a change from being merged label Sep 25, 2024
@basuke basuke marked this pull request as ready for review September 25, 2024 23:06
@basuke basuke requested a review from cdumez September 25, 2024 23:06
Comment thread Source/WebKit/UIProcess/API/Cocoa/PageLoadStateObserver.h Outdated
Comment thread Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm Outdated
Comment thread Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp Outdated
@basuke basuke marked this pull request as draft September 26, 2024 20:49
@basuke basuke marked this pull request as ready for review September 26, 2024 21:03
@basuke basuke requested a review from cdumez September 26, 2024 21:04
Copy link
Copy Markdown
Contributor

@cdumez cdumez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should return a Ref<> since it cannot return nullptr.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return adoptRef(*new StateClient(client));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should return a Ref<>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous style was correct, since this is an Objective C type.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 27, 2024
@basuke basuke removed the merging-blocked Applied to prevent a change from being merged label Sep 27, 2024
@basuke basuke added the merge-queue Applied to send a pull request to merge-queue label Sep 27, 2024
…ated classes RefCounted or equivalent

https://bugs.webkit.org/show_bug.cgi?id=280282

Reviewed by Chris Dumez.

Those classes are CanMakeWeakPtr so that need to be lifecycle manageable.

* Source/WebKit/UIProcess/API/C/WKPage.cpp:
(WKPageSetPageStateClient):
* Source/WebKit/UIProcess/API/C/mac/WKPagePrivateMac.mm:
(-[WKObservablePageState initWithPage:]):
* Source/WebKit/UIProcess/API/Cocoa/PageLoadStateObserver.h:
* Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController _initWithPageRef:]):
(WebKit::PageLoadStateObserver::ref const):
(WebKit::PageLoadStateObserver::deref const):
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewConstructed):
(webkitWebViewDispose):
* Source/WebKit/UIProcess/Cocoa/NavigationState.h:
* Source/WebKit/UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::ref const):
(WebKit::NavigationState::deref const):
* Source/WebKit/UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::callObserverCallback):
* Source/WebKit/UIProcess/PageLoadState.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setPageLoadStateObserver):
* Source/WebKit/UIProcess/WebPageProxy.h:

Canonical link: https://commits.webkit.org/284380@main
@webkit-commit-queue
Copy link
Copy Markdown
Collaborator

Committed 284380@main (0eadc69): https://commits.webkit.org/284380@main

Reviewed commits have been landed. Closing PR #34183 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 0eadc69 into WebKit:main Sep 27, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Sep 27, 2024
@basuke basuke deleted the eng/280282 branch January 16, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebKit2 Bugs relating to the WebKit2 API layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants