Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: eb81577b89c438828700491a6fd52306b678ac2f
https://github.com/WebKit/WebKit/commit/eb81577b89c438828700491a6fd52306b678ac2f
Author: Ben Nham <[email protected]>
Date: 2024-09-25 (Wed, 25 Sep 2024)
Changed paths:
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
M Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h
M Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm
M Source/WebKit/UIProcess/PageClient.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/WebProcessPool.h
M Source/WebKit/UIProcess/WebProcessProxy.cpp
M Source/WebKit/UIProcess/WebProcessProxy.h
Log Message:
-----------
Add method for observing web process state via WKWebView
https://bugs.webkit.org/show_bug.cgi?id=280355
rdar://136707641
Reviewed by Brady Eidson.
For debugging purposes, it can be useful for the embedder to be able to observe
process state
changes. For instance, the embedder might use this to add debug info to the tab
title to let a user
quickly know if a tab is associated with a process that is in the foreground,
background, or
suspended.
I did this by adding a `_webProcessState` property to WKWebView. The property
is KVO-compliant. To
avoid perf issues, we only start shipping process state updates back to the
embedder if the embedder
actually registers for KVO notifications on that property.
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView addObserver:forKeyPath:options:context:]):
(-[WKWebView _webProcessState]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h:
* Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::processDidUpdateThrottleState):
* Source/WebKit/UIProcess/PageClient.h:
(WebKit::PageClient::processDidUpdateThrottleState):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidUpdateThrottleState):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::updateRuntimeStatistics):
* Source/WebKit/UIProcess/WebProcessProxy.h:
Canonical link: https://commits.webkit.org/284261@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes