tree: a078c9747d0aaea952b787292cc461c07efeac24 [path history] [tgz]
  1. COMMON_METADATA
  2. compute_pressure_host.cc
  3. compute_pressure_host.h
  4. compute_pressure_host_unittest.cc
  5. compute_pressure_manager.cc
  6. compute_pressure_manager.h
  7. compute_pressure_manager_unittest.cc
  8. compute_pressure_origin_trial_browsertest.cc
  9. compute_pressure_quantizer.cc
  10. compute_pressure_quantizer.h
  11. compute_pressure_quantizer_unittest.cc
  12. compute_pressure_sample.h
  13. compute_pressure_sampler.cc
  14. compute_pressure_sampler.h
  15. compute_pressure_sampler_unittest.cc
  16. compute_pressure_test_support.cc
  17. compute_pressure_test_support.h
  18. cpu_core_speed_info.cc
  19. cpu_core_speed_info.h
  20. cpu_core_speed_info_unittest.cc
  21. cpu_probe.cc
  22. cpu_probe.h
  23. cpu_probe_linux.cc
  24. cpu_probe_linux.h
  25. cpu_probe_linux_unittest.cc
  26. cpuid_base_frequency_parser.cc
  27. cpuid_base_frequency_parser.h
  28. cpuid_base_frequency_parser_unittest.cc
  29. DIR_METADATA
  30. OWNERS
  31. procfs_stat_cpu_parser.cc
  32. procfs_stat_cpu_parser.h
  33. procfs_stat_cpu_parser_unittest.cc
  34. README.md
  35. sysfs_cpufreq_core_parser.cc
  36. sysfs_cpufreq_core_parser.h
  37. sysfs_cpufreq_core_parser_unittest.cc
content/browser/compute_pressure/README.md

Compute Pressure API

This directory contains the browser-side implementation of the Compute Pressure API.

Code map

The system is made up of the following components.

blink::mojom::ComputePressureHost, defined in Blink, is the interface between the renderer and the browser sides of the API implementation.

content::ComputePressureManager is the top-level class for the browser-side implementation. Each instance handles the Compute Pressure API needs for a user profile. The class is responsible for coordinating between the objects that serve mojo requests from renderers, and the objects that collect compute pressure information from the underlying operating system.

content::ComputePressureHost serves all the mojo connections from renderers related to an origin. Each instance is owned by a ComputePressureManager, which is responsible for creating and destorying instances as needed to meet renderer requests.

content::ComputePressureSampler drives measuring the device‘s compute pressure state. The class is responsible for invoking platform-specific measurement code at regular intervals, and for straddling between sequences to meet the platform-specific code’s requirements.

content::CpuProbe is an abstract base class that interfaces between ComputePressureSampler and platform-specific code that retrieves the compute pressure state from the operating system. This interface is also a dependency injection point for tests.

content::ComputePressureSample represents the device's compute pressure state. This information is collected by CpuProbe and bubbled up by ComputePressureSampler to ComputePressureManager, which broadcats the information to the ComputePressureHost instances that it owns.

content::ComputePressureQuantizer implements the quantization logic that converts a high-entropy ComputePressureSample into a low-entropy blink::mojom::ComputePressureState, which minimizes the amount of information exposed to a Web page that uses the Compute Pressure API. Each ComputePressureHost uses a ComputePressureQuantizer instance, which stores the origin's quantization schema and produces quantized data suitable for Web pages served from that origin.