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

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

Issue 2933503002: Add IsCurrentlyLowMemory (Closed)
Patch Set: added comment Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/platform/MemoryCoordinator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e9cf30ecc38c666af82bc02d338f4a2c3819ab03..7e08795fef6777382a658d8a9c416edf38fb73a3 100644
--- a/third_party/WebKit/Source/platform/MemoryCoordinator.cpp
+++ b/third_party/WebKit/Source/platform/MemoryCoordinator.cpp
@@ -10,6 +10,10 @@
#include "platform/instrumentation/tracing/TraceEvent.h"
#include "platform/wtf/allocator/Partitions.h"
+#if OS(ANDROID)
+#include "base/android/sys_utils.h"
+#endif
+
namespace blink {
// static
@@ -32,6 +36,15 @@ void MemoryCoordinator::SetPhysicalMemoryMBForTesting(
physical_memory_mb_ = physical_memory_mb;
}
+// static
+bool MemoryCoordinator::IsCurrentlyLowMemory() {
+#if OS(ANDROID)
+ return base::android::SysUtils::IsCurrentlyLowMemory();
+#else
+ return false;
+#endif
+}
+
// static
void MemoryCoordinator::Initialize() {
is_low_end_device_ = ::base::SysInfo::IsLowEndDevice();
« no previous file with comments | « third_party/WebKit/Source/platform/MemoryCoordinator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698