[ComputePressure] Make ComputePressure as a service.

The patch makes ComputePressure as a service and the major
changes are:
1. Move ComputePressureManager and related classes from
content/browser to services/device. Rename ComputePressureManager
to ComputePressureManagerImpl.
2. Rename ComputePressureHost to ComputePressureServiceImpl.
3. ComputePressureSample data are collected in service now and then
send to ComputePressureServiceImpl. If the data changes and meets
frequency requirement, ComputePressureServiceImpl will send the
data to Blink.
4. CpuProbe collects data only when there is active
ComputePressureObserver. It stops collecting when all
ComputePressureObservers become inactive.

The compute_pressure_different_quantizations_across_iframes test
fails in this patch. However, there is no concept of the quantization
in the newest spec any more and we will remove this test in the
future.

Bug: 1205695, 1311945
Change-Id: I388ce2ea3d7be2e717c080d92c77b8d0b3570f03
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3661519
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Wei4 Wang <wei4.wang@intel.com>
Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1025483}
diff --git a/compute-pressure/compute_pressure_detached_iframe.tentative.https.html b/compute-pressure/compute_pressure_detached_iframe.tentative.https.html
index 4ebb1ca..16a243f 100644
--- a/compute-pressure/compute_pressure_detached_iframe.tentative.https.html
+++ b/compute-pressure/compute_pressure_detached_iframe.tentative.https.html
@@ -29,7 +29,7 @@
   iframe.remove();
 
   // Calling observe() from a detached iframe should fail but not crash.
-  await promise_rejects_dom(t, 'InvalidStateError', iframe_DOMException,
+  await promise_rejects_dom(t, 'NotSupportedError', iframe_DOMException,
                             observer.observe('cpu'));
 }, 'ComputePressureObserver.observe() on detached frame rejects');
 
diff --git a/compute-pressure/compute_pressure_different_quantizations.tentative.https.window.js b/compute-pressure/compute_pressure_different_quantizations.tentative.https.window.js
index 923a4b6..86f85fc 100644
--- a/compute-pressure/compute_pressure_different_quantizations.tentative.https.window.js
+++ b/compute-pressure/compute_pressure_different_quantizations.tentative.https.window.js
@@ -6,7 +6,7 @@
       update => { observer1_updates.push(update); },
       {cpuUtilizationThresholds: [0.5], cpuSpeedThresholds: [0.5]});
   t.add_cleanup(() => observer1.disconnect());
-  // Ensure that observer1's quantization scheme gets registered as the origin's
+  // Ensure that observer1's quantization scheme gets registered as the frame's
   // scheme before observer2 starts.
   await observer1.observe('cpu');
 
@@ -76,4 +76,4 @@
                   'cpuSpeed quantization');
 
 }, 'ComputePressureObserver with a new quantization schema stops all ' +
-   'other active observers');
+   'other active observers in the same frame');