[webkit-changes] [WebKit/WebKit] 00f95e: Initial thermal state in WebContent is always NSPr...
bnham
noreply at github.com
Thu Jan 30 14:21:17 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 00f95e0037145a1d86b3dbf398157f319f8905bd
https://github.com/WebKit/WebKit/commit/00f95e0037145a1d86b3dbf398157f319f8905bd
Author: Ben Nham <nham at apple.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M Source/WebKit/Resources/cocoa/NotificationAllowList/ForwardedNotifications.def
M Source/WebKit/Shared/WebProcessCreationParameters.h
M Source/WebKit/Shared/WebProcessCreationParameters.serialization.in
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm
M Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
M Source/WebKit/UIProcess/WebProcessPool.h
M Source/WebKit/UIProcess/WebProcessProxy.cpp
M Source/WebKit/UIProcess/WebProcessProxy.h
M Source/WebKit/WebProcess/WebProcess.h
M Source/WebKit/WebProcess/WebProcess.messages.in
M Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
M Tools/TestWebKitAPI/SourcesCocoa.txt
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewNotificationForwarding.mm
Log Message:
-----------
Initial thermal state in WebContent is always NSProcessInfoThermalStateNominal
https://bugs.webkit.org/show_bug.cgi?id=286651
rdar://143596122
Reviewed by Per Arne Vollan.
The initial thermal state in WebContent is always NSProcessInfoThermalStateNominal. This is because
the thermal state is provided by a notify state token, and we don't seed the initial value of the
state token upon process creation.
Fix this by keeping a map of the current notify state for all tokens and providing this to
WebContent processes when they spawn.
* Source/WebKit/Resources/cocoa/NotificationAllowList/ForwardedNotifications.def:
* Source/WebKit/Shared/WebProcessCreationParameters.h:
* Source/WebKit/Shared/WebProcessCreationParameters.serialization.in:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _getNotifyStateForTesting:completionHandler:]):
* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
(WebKit::WebProcessPool::setNotifyState):
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getNotifyStateForTesting):
* Source/WebKit/UIProcess/WebProcessProxy.h:
* Source/WebKit/WebProcess/WebProcess.h:
* Source/WebKit/WebProcess/WebProcess.messages.in:
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::postNotification):
(WebKit::WebProcess::setNotifyState):
(WebKit::WebProcess::getNotifyStateForTesting):
* Tools/TestWebKitAPI/SourcesCocoa.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewNotificationForwarding.mm: Added.
(getNotifyState):
(TEST(WKWebView, NotifyStateIsInitiallySetAndForwarded)):
Canonical link: https://commits.webkit.org/289583@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list