We should consider moving the CPU limit support from WebProcessCocoa.mm into cross-platform code, and adding a new WEBKIT_WEB_PROCESS_EXCEEDED_CPU_LIMIT termination reason. Looks straightforward. The only hard part would be choosing the right limit. Cocoa makes it configurable via API, but I suspect a hardcoded limit would work better for WPE/GTK. It's not clear what that limit should be, though.
If it's not clear what that limit should be, how can you hardcode it? It may be different for different kinds of applications or target systems
Seconded, i occasionally use webkitgtk for svg/dom SSR intensive tasks that can load cpu at 100% for several minutes with very high memory usage. Having limits that way is an important feature, but it's also important to be able to switch them off.
Please understand the web process will be killed if the CPU limit is reached. So you'll have to make sure your web content does NOT trigger the limit. It won't be a friendly limit that just throttles you. Point is a web browser should not be executing CPU-intensive content for long as it could drain the user's battery life.
>Point is a web browser should not be executing CPU-intensive content for long as it could drain the user's battery life. Which is the last thing could I care about when my PC is plugged into AC network :)
What is actually important for users is blocking or at least detection of scripts which siltently do cryptomining in background
*for desktop users; embedded story is different, draining CPU here may make whole system unusable so it's often preferred to break misbehaving content in order to preserve stability