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

Unified Diff: content/child/blink_platform_impl.cc

Issue 2860093003: Implement device-ram client hints header (Closed)
Patch Set: Rebase 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: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 94eaffa8859985a83725547917291cf3e7b1e4ef..2a7ff521f7726bd650a021a5d223ecc3edd32dde 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -360,7 +360,9 @@ BlinkPlatformImpl::BlinkPlatformImpl()
BlinkPlatformImpl::BlinkPlatformImpl(
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner)
: main_thread_task_runner_(main_thread_task_runner),
- compositor_thread_(nullptr) {
+ compositor_thread_(nullptr),
+ physical_memory_mb_(
+ static_cast<size_t>(base::SysInfo::AmountOfPhysicalMemoryMB())) {
kinuko 2017/05/25 05:31:27 Hum, this doesn't seem we need public platform plu
InternalInit();
}
@@ -777,6 +779,15 @@ size_t BlinkPlatformImpl::ActualMemoryUsageMB() {
return GetMemoryUsageKB() >> 10;
}
+size_t BlinkPlatformImpl::AmountOfPhysicalMemoryMB() {
+ return physical_memory_mb_;
+}
+
+void BlinkPlatformImpl::SetDevicePhysicalMemoryMBForTesting(
+ int64_t physical_memory_mb) {
+ physical_memory_mb_ = static_cast<size_t>(physical_memory_mb);
+}
+
size_t BlinkPlatformImpl::NumberOfProcessors() {
return static_cast<size_t>(base::SysInfo::NumberOfProcessors());
}

Powered by Google App Engine
This is Rietveld 408576698