Global Resource Controller
NOTE: This CL is just a prototype and shouldn't actually land; it needs to be split up and have tests added, after feedback.
GRC parent doc (internal only):
https://docs.google.com/document/d/1dx4KDbDFvP-GWwwrSPg8Gxx4kboIoPi8kDKTSXoTbC4/edit#heading=h.td4yhfm12fe3
This CL depends on
https://codereview.chromium.org/2798713002
This thing should theoretically improve
https://bugs.chromium.org/p/chromium/issues/detail?id=693054 once the kinks are worked out, by lowering process priority for background tabs even before they've started painting.
Quick design tl;dr:
The basic Mojo interface is a CoordinationUnit. This can be created by the browser process through a CoordinationUnitInterface, and can be duplicated on demand from other processes (there's an example in the CL of Blink hooking up to the frame-level CoordinationUnit). It can be used to send events through (currently just basic enums with no args), and can be used to set a callback if the client of the CoordinationUnit is interested in receiving resource policy updates (as shown by RenderProcessHostImpl, which receives a should_background policy).
There's CoordinationUnits hooked up to three different levels in this CL:
* WebContents-level
* Process-level
* Frame-level (Both Blink and browser-side; this is currently unused by the prototype but there for demonstration purposes).
There's also a ResourceCoordinatorInterface helper class included, which wraps around the CoordinationUnit for easier usage, and has functionality to set up parent/child relationships between different units.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation