Commit fa87fc51 authored by Rafael Cintron's avatar Rafael Cintron Committed by Commit Bot

Expose kForwardMemoryPressureEventsToGpuProcess in content_features.h

Expose kForwardMemoryPressureEventsToGpuProcess in content_features.h
so that it can more easily be used by Chromium hosts.

Bug: 1048924
Change-Id: I911f44b0274be30d5b33b01a0ec2c338417920a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036801Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#738452}
parent 63820ece
......@@ -52,6 +52,7 @@
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/gpu_utils.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/result_codes.h"
#include "content/public/common/sandboxed_process_launcher_delegate.h"
......@@ -151,19 +152,6 @@ int GetForgiveMinutes(gpu::GpuMode gpu_mode) {
: kForgiveGpuCrashMinutes;
}
#if !defined(OS_ANDROID)
// Feature controlling whether or not memory pressure signals will be forwarded
// to the GPU process.
const base::Feature kForwardMemoryPressureEventsToGpuProcess{
"ForwardMemoryPressureEventsToGpuProcess",
#if defined(OS_FUCHSIA)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
};
#endif
// This matches base::TerminationStatus.
// These values are persisted to logs. Entries (except MAX_ENUM) should not be
// renumbered and numeric values should never be reused. Should also avoid
......@@ -678,8 +666,8 @@ GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind)
in_process_ = true;
}
#if !defined(OS_ANDROID)
if (!in_process_ &&
base::FeatureList::IsEnabled(kForwardMemoryPressureEventsToGpuProcess)) {
if (!in_process_ && base::FeatureList::IsEnabled(
features::kForwardMemoryPressureEventsToGpuProcess)) {
memory_pressure_listener_ =
std::make_unique<base::MemoryPressureListener>(base::BindRepeating(
&GpuProcessHost::OnMemoryPressure, base::Unretained(this)));
......
......@@ -202,6 +202,19 @@ const base::Feature kFontSrcLocalMatching{"FontSrcLocalMatching",
const base::Feature kForcedColors{"ForcedColors",
base::FEATURE_DISABLED_BY_DEFAULT};
#if !defined(OS_ANDROID)
// Feature controlling whether or not memory pressure signals will be forwarded
// to the GPU process.
const base::Feature kForwardMemoryPressureEventsToGpuProcess {
"ForwardMemoryPressureEventsToGpuProcess",
#if defined(OS_FUCHSIA)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
};
#endif
// Enables scrollers inside Blink to store scroll offsets in fractional
// floating-point numbers rather than truncating to integers.
const base::Feature kFractionalScrollOffsets{"FractionalScrollOffsets",
......
......@@ -55,6 +55,10 @@ CONTENT_EXPORT extern const base::Feature kFeaturePolicyForClientHints;
CONTENT_EXPORT extern const base::Feature kFeaturePolicyForSandbox;
CONTENT_EXPORT extern const base::Feature kFontSrcLocalMatching;
CONTENT_EXPORT extern const base::Feature kForcedColors;
#if !defined(OS_ANDROID)
CONTENT_EXPORT extern const base::Feature
kForwardMemoryPressureEventsToGpuProcess;
#endif
CONTENT_EXPORT extern const base::Feature kFractionalScrollOffsets;
CONTENT_EXPORT extern const base::Feature kFtpProtocol;
CONTENT_EXPORT extern const base::Feature kHistoryManipulationIntervention;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment