[wpt-sync] Sync PR 38257 - compute pressure: Manage sampleRate changes
Categories
(Testing :: web-platform-tests, task, P4)
Tracking
(Not tracked)
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 38257 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/38257
Details from upstream follow.
Arnaud Mandy <arnaud.mandy@intel.com> wrote:
compute pressure: Manage sampleRate changes
This patch implements the sampling interval adaptation based on changes
in the activePressureObserver
objects.On the Blink side, each
PressureObserverManager
object is responsible
for providing thePressureManager
object with a set of sampling
rate inverse, from activePressureObserver
s, called sampling
intervalsWhenever a
PressureObserver
is created with asampleRate
and starts
to observe, thePressureObserverManager
will add the sampling interval
to the set of active sampling interval. If the value is not already
present in the set, a message is sent to thePressureManager
remote, to inform the platform collector of a new sampling interval
request.In the same way whenever a
PressureObserver
unobserve/disconnect
and its requested sample rate is not equal to other
PressureObserver
s. The sampling interval will be removed from the
set and thePressureManager
remote will be informed that the
value was removed.As already described above, to avoid useless messaging, only values
not existing in the set of sampling interval, will be sent to the
PressureManager
.in //service, the
PressureManager
will keep a set of sampling
intervals per client.Every time a single client set of sampling interval is updated,
a new common sampling interval will be calculated.
Every time a client is disconnected. a new common sampling interval
is calculated.We do not recalculate the sampling interval based on client focus,
because it can be quite costly to recalculate and restart the timer
for every focus change on Blink.In case a common sampling interval cannot be found, the default
pressure manager sampling interval is used.MockPressureService in WPT testing and tests using MockPressureService
have been adapted accordingly to the change described above.Bug: 1371373
Change-Id: I289892f7b1936fd90099e0c0f3c8540613b41f5c
Reviewed-on: https://chromium-review.googlesource.com/4189112
WPT-Export-Revision: 4ea90580e7d4ba06892a621a4dda346317286ee9
Description
•