summaryrefslogblamecommitdiff
path: root/www-client/chromium/files/chromium-87-SystemMemoryPressureEvaluator-namespace.patch
blob: 3129a75ec9e637bee793686eb9bacb765bf55f93 (plain) (tree)





































































                                                                                                                                                      
From b73f096a06f4241a1459b0e02ddaa0bb4e14f7a1 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Fri, 4 Sep 2020 17:57:22 +0000
Subject: [PATCH] GCC: fix clash in predefined macro "linux"

"linux" is predefined in GCC and can't be used for namespace name.
---
 base/util/memory_pressure/system_memory_pressure_evaluator.cc | 2 +-
 .../memory_pressure/system_memory_pressure_evaluator_linux.cc | 4 ++--
 .../memory_pressure/system_memory_pressure_evaluator_linux.h  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/base/util/memory_pressure/system_memory_pressure_evaluator.cc b/base/util/memory_pressure/system_memory_pressure_evaluator.cc
index babb4f8..4a9963b 100644
--- a/base/util/memory_pressure/system_memory_pressure_evaluator.cc
+++ b/base/util/memory_pressure/system_memory_pressure_evaluator.cc
@@ -46,7 +46,7 @@ SystemMemoryPressureEvaluator::CreateDefaultSystemEvaluator(
   }
   return evaluator;
 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
-  return std::make_unique<util::linux::SystemMemoryPressureEvaluator>(
+  return std::make_unique<util::os_linux::SystemMemoryPressureEvaluator>(
       monitor->CreateVoter());
 #endif
   return nullptr;
diff --git a/base/util/memory_pressure/system_memory_pressure_evaluator_linux.cc b/base/util/memory_pressure/system_memory_pressure_evaluator_linux.cc
index 258d983..1878d88 100644
--- a/base/util/memory_pressure/system_memory_pressure_evaluator_linux.cc
+++ b/base/util/memory_pressure/system_memory_pressure_evaluator_linux.cc
@@ -32,7 +32,7 @@ int GetAvailableSystemMemoryMiB(const base::SystemMemoryInfoKB& mem_info) {
 }  // namespace
 
 namespace util {
-namespace linux {
+namespace os_linux {
 
 const base::TimeDelta SystemMemoryPressureEvaluator::kModeratePressureCooldown =
     base::TimeDelta::FromSeconds(10);
@@ -153,5 +153,5 @@ SystemMemoryPressureEvaluator::CalculateCurrentPressureLevel() {
   return base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE;
 }
 
-}  // namespace linux
+}  // namespace os_linux
 }  // namespace util
diff --git a/base/util/memory_pressure/system_memory_pressure_evaluator_linux.h b/base/util/memory_pressure/system_memory_pressure_evaluator_linux.h
index 0f5c43d..3a24427 100644
--- a/base/util/memory_pressure/system_memory_pressure_evaluator_linux.h
+++ b/base/util/memory_pressure/system_memory_pressure_evaluator_linux.h
@@ -13,7 +13,7 @@
 #include "base/util/memory_pressure/system_memory_pressure_evaluator.h"
 
 namespace util {
-namespace linux {
+namespace os_linux {
 
 // Linux memory pressure voter. Because there is no OS provided signal this
 // polls at a low frequency, and applies internal hysteresis.
@@ -106,7 +106,7 @@ class SystemMemoryPressureEvaluator
   SEQUENCE_CHECKER(sequence_checker_);
 };
 
-}  // namespace linux
+}  // namespace os_linux
 }  // namespace util
 
 #endif  // BASE_UTIL_MEMORY_PRESSURE_SYSTEM_MEMORY_PRESSURE_EVALUATOR_LINUX_H_
-- 
2.26.2