Index: third_party/WebKit/Source/platform/MemoryCoordinator.cpp |
diff --git a/third_party/WebKit/Source/platform/MemoryCoordinator.cpp b/third_party/WebKit/Source/platform/MemoryCoordinator.cpp |
index c15750196f607b0d2508a86bf6a4368ba918f389..e9cf30ecc38c666af82bc02d338f4a2c3819ab03 100644 |
--- a/third_party/WebKit/Source/platform/MemoryCoordinator.cpp |
+++ b/third_party/WebKit/Source/platform/MemoryCoordinator.cpp |
@@ -14,6 +14,7 @@ namespace blink { |
// static |
bool MemoryCoordinator::is_low_end_device_ = false; |
+int64_t MemoryCoordinator::physical_memory_mb_ = 0; |
// static |
bool MemoryCoordinator::IsLowEndDevice() { |
@@ -21,8 +22,20 @@ bool MemoryCoordinator::IsLowEndDevice() { |
} |
// static |
+int64_t MemoryCoordinator::GetPhysicalMemoryMB() { |
+ return physical_memory_mb_; |
+} |
+ |
+// static |
+void MemoryCoordinator::SetPhysicalMemoryMBForTesting( |
+ int64_t physical_memory_mb) { |
+ physical_memory_mb_ = physical_memory_mb; |
+} |
+ |
+// static |
void MemoryCoordinator::Initialize() { |
is_low_end_device_ = ::base::SysInfo::IsLowEndDevice(); |
+ physical_memory_mb_ = ::base::SysInfo::AmountOfPhysicalMemoryMB(); |
} |
// static |