Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(885)

Unified Diff: third_party/WebKit/Source/platform/MemoryCoordinator.cpp

Issue 2860093003: Implement device-ram client hints header (Closed)
Patch Set: Rebase UseCounter.h Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698