Commit e541c362 authored by Jason Roberts's avatar Jason Roberts Committed by Commit Bot

Set discardable shared memory limit to 64MB on Chromecast devices.

Bug: 876359
Change-Id: I554cdd9a7124312da670e6d1878b0bcddb2d74f5
Reviewed-on: https://chromium-review.googlesource.com/1183887
Commit-Queue: Jason Roberts <jasonroberts@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585169}
parent 999dcf66
...@@ -152,6 +152,12 @@ class DiscardableMemoryImpl : public base::DiscardableMemory { ...@@ -152,6 +152,12 @@ class DiscardableMemoryImpl : public base::DiscardableMemory {
int64_t GetDefaultMemoryLimit() { int64_t GetDefaultMemoryLimit() {
const int kMegabyte = 1024 * 1024; const int kMegabyte = 1024 * 1024;
#if defined(CHROMECAST_BUILD)
// Bypass IsLowEndDevice() check and fix max_default_memory_limit to 64MB on
// Chromecast devices. Set value here as IsLowEndDevice() is used on some, but
// not all Chromecast devices.
int64_t max_default_memory_limit = 64 * kMegabyte;
#else
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
// Limits the number of FDs used to 32, assuming a 4MB allocation size. // Limits the number of FDs used to 32, assuming a 4MB allocation size.
int64_t max_default_memory_limit = 128 * kMegabyte; int64_t max_default_memory_limit = 128 * kMegabyte;
...@@ -162,6 +168,7 @@ int64_t GetDefaultMemoryLimit() { ...@@ -162,6 +168,7 @@ int64_t GetDefaultMemoryLimit() {
// Use 1/8th of discardable memory on low-end devices. // Use 1/8th of discardable memory on low-end devices.
if (base::SysInfo::IsLowEndDevice()) if (base::SysInfo::IsLowEndDevice())
max_default_memory_limit /= 8; max_default_memory_limit /= 8;
#endif
#if defined(OS_LINUX) #if defined(OS_LINUX)
base::FilePath shmem_dir; base::FilePath shmem_dir;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment