From f5e495c3577b99b225c561b637f9699735039e91 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Sun, 2 Jul 2023 14:31:59 +0200 Subject: [PATCH] Remove support for device memory and cpu recovery --- build/bromite_patches_list.txt | 3 +- ...t-for-device-memory-and-cpu-recovery.patch | 84 +++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 build/patches/00Remove-support-for-device-memory-and-cpu-recovery.patch diff --git a/build/bromite_patches_list.txt b/build/bromite_patches_list.txt index a7cbca9f..4d9df4a2 100644 --- a/build/bromite_patches_list.txt +++ b/build/bromite_patches_list.txt @@ -278,4 +278,5 @@ Show-site-settings-for-cookies-javascript-and-ads.patch Viewport-Protection-flag.patch Viewport-Protection-Site-Setting.patch Timezone-customization.patch -00Disable-speechSynthesis-getVoices-API.patch \ No newline at end of file +00Disable-speechSynthesis-getVoices-API.patch +00Remove-support-for-device-memory-and-cpu-recovery.patch \ No newline at end of file diff --git a/build/patches/00Remove-support-for-device-memory-and-cpu-recovery.patch b/build/patches/00Remove-support-for-device-memory-and-cpu-recovery.patch new file mode 100644 index 00000000..87635be0 --- /dev/null +++ b/build/patches/00Remove-support-for-device-memory-and-cpu-recovery.patch @@ -0,0 +1,84 @@ +From: uazo +Date: Tue, 27 Jun 2023 11:11:53 +0000 +Subject: Remove support for device memory and cpu recovery + +--- + .../common/device_memory/approximated_device_memory.cc | 7 ++++++- + third_party/blink/common/features.cc | 4 ++-- + .../renderer/core/frame/navigator_concurrent_hardware.cc | 8 ++++++-- + .../blink/renderer/core/timing/window_performance.cc | 1 + + 4 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/third_party/blink/common/device_memory/approximated_device_memory.cc b/third_party/blink/common/device_memory/approximated_device_memory.cc +--- a/third_party/blink/common/device_memory/approximated_device_memory.cc ++++ b/third_party/blink/common/device_memory/approximated_device_memory.cc +@@ -4,13 +4,18 @@ + + #include "third_party/blink/public/common/device_memory/approximated_device_memory.h" + ++#include "build/build_config.h" + #include "base/check_op.h" + #include "base/system/sys_info.h" + + namespace blink { + + // static +-float ApproximatedDeviceMemory::approximated_device_memory_gb_ = 0.0; ++#if BUILDFLAG(IS_ANDROID) ++float ApproximatedDeviceMemory::approximated_device_memory_gb_ = 4.0; ++#else ++float ApproximatedDeviceMemory::approximated_device_memory_gb_ = 8.0; ++#endif + int64_t ApproximatedDeviceMemory::physical_memory_mb_ = 0; + + // static +diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc +--- a/third_party/blink/common/features.cc ++++ b/third_party/blink/common/features.cc +@@ -418,8 +418,8 @@ BASE_FEATURE(kV8OptimizeWorkersForPerformance, + // Controls whether the implementation of the performance.measureMemory + // web API uses PerformanceManager or not. + BASE_FEATURE(kWebMeasureMemoryViaPerformanceManager, +- "WebMeasureMemoryViaPerformanceManager", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ "WebMeasureMemoryViaPerformanceManager", // need to be ++ base::FEATURE_DISABLED_BY_DEFAULT); // disabled by default + + // Enables negotiation of experimental multiplex codec in SDP. + BASE_FEATURE(kWebRtcMultiplexCodec, +diff --git a/third_party/blink/renderer/core/frame/navigator_concurrent_hardware.cc b/third_party/blink/renderer/core/frame/navigator_concurrent_hardware.cc +--- a/third_party/blink/renderer/core/frame/navigator_concurrent_hardware.cc ++++ b/third_party/blink/renderer/core/frame/navigator_concurrent_hardware.cc +@@ -3,13 +3,17 @@ + // found in the LICENSE file. + + #include "third_party/blink/renderer/core/frame/navigator_concurrent_hardware.h" +- ++#include "build/build_config.h" + #include "base/system/sys_info.h" + + namespace blink { + + unsigned NavigatorConcurrentHardware::hardwareConcurrency() const { +- return static_cast(base::SysInfo::NumberOfProcessors()); ++#if BUILDFLAG(IS_ANDROID) ++ return static_cast(2); ++#else ++ return static_cast(8); ++#endif + } + + } // namespace blink +diff --git a/third_party/blink/renderer/core/timing/window_performance.cc b/third_party/blink/renderer/core/timing/window_performance.cc +--- a/third_party/blink/renderer/core/timing/window_performance.cc ++++ b/third_party/blink/renderer/core/timing/window_performance.cc +@@ -239,6 +239,7 @@ PerformanceNavigation* WindowPerformance::navigation() const { + } + + MemoryInfo* WindowPerformance::memory(ScriptState* script_state) const { ++ if ((true)) return nullptr; + // The performance.memory() API has been improved so that we report precise + // values when the process is locked to a site. The intent (which changed + // course over time about what changes would be implemented) can be found at +-- +2.25.1