| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
public:The comment refers to "this TaskRunner", but this is a static method, so it's not so clear what "this TaskRunner" means. It's definitely not the TaskRunner on which this is called in:
`task_runner->GetCurrentThreadType()`
To reduce confusion, I suggest making this a standalone function. Depending on where you plan to use this, it could be in the anonymous namespace?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
base::ThreadType ToThreadType(TaskPriority priority) {Hi, sorry for the drive-by, but I have a question about this: how will this be used in the renderer, and is this the best fit for thread type (vs. UseCase)?
We use priority in blink a lot for relative ordering of various things, and I don't know how well that really matches thread priority. For example, during loading we:
- Run image loading tasks at extremely high priority so it happens before the next paint (i.e. this is coordinated with rendering priority), which helps prevent layout shift (by a good amount IIRC) and has a small LCP benefit (~1 frame max improvement).
- We periodically bump up rendering priority (to very high) to balance loading tasks and rendering.
- We also use very high priority internally for script continuation, e.g. to break up executing module scripts during loading, where we want input and maybe rendering to run, but not other things.
In all cases I don't know that the elevated priority implies a difference in thread priority compared to the other loading tasks (normal priority)? Some other recent features, e.g. [1], are using UseCase to determine drive performance settings, so I'm wondering if we should align this (assuming this will drive thread priority).