Commit 2f7a8e80 authored by reveman's avatar reveman Committed by Commit bot

Re-land: base: Enable browser-wide discardable memory on Linux, CrOS and Windows.

This makes SHMEM implementation of discardable memory preferred
over EMULATED implementation. This effectively makes SHMEM the
implementation used by default on Linux, CrOS and Windows.

SHMEM implementation of discardable memory gives the browser
process control over the total amount of discardable memory used
and allows us to enforce a global limit of 512MB across all
renderers.

BUG=429415,429416

Review URL: https://codereview.chromium.org/793443003

Cr-Commit-Position: refs/heads/master@{#316977}
parent 40304324
......@@ -53,8 +53,8 @@ void DiscardableMemory::GetSupportedTypes(
std::vector<DiscardableMemoryType>* types) {
const DiscardableMemoryType supported_types[] = {
DISCARDABLE_MEMORY_TYPE_ASHMEM,
DISCARDABLE_MEMORY_TYPE_EMULATED,
DISCARDABLE_MEMORY_TYPE_SHMEM
DISCARDABLE_MEMORY_TYPE_SHMEM,
DISCARDABLE_MEMORY_TYPE_EMULATED
};
types->assign(supported_types, supported_types + arraysize(supported_types));
}
......
......@@ -19,8 +19,8 @@ bool DiscardableMemory::ReduceMemoryUsage() {
void DiscardableMemory::GetSupportedTypes(
std::vector<DiscardableMemoryType>* types) {
const DiscardableMemoryType supported_types[] = {
DISCARDABLE_MEMORY_TYPE_EMULATED,
DISCARDABLE_MEMORY_TYPE_SHMEM
DISCARDABLE_MEMORY_TYPE_SHMEM,
DISCARDABLE_MEMORY_TYPE_EMULATED
};
types->assign(supported_types, supported_types + arraysize(supported_types));
}
......
......@@ -23,8 +23,8 @@ void DiscardableMemory::GetSupportedTypes(
std::vector<DiscardableMemoryType>* types) {
const DiscardableMemoryType supported_types[] = {
DISCARDABLE_MEMORY_TYPE_MACH,
DISCARDABLE_MEMORY_TYPE_EMULATED,
DISCARDABLE_MEMORY_TYPE_SHMEM
DISCARDABLE_MEMORY_TYPE_SHMEM,
DISCARDABLE_MEMORY_TYPE_EMULATED
};
types->assign(supported_types, supported_types + arraysize(supported_types));
}
......
......@@ -19,8 +19,8 @@ bool DiscardableMemory::ReduceMemoryUsage() {
void DiscardableMemory::GetSupportedTypes(
std::vector<DiscardableMemoryType>* types) {
const DiscardableMemoryType supported_types[] = {
DISCARDABLE_MEMORY_TYPE_EMULATED,
DISCARDABLE_MEMORY_TYPE_SHMEM
DISCARDABLE_MEMORY_TYPE_SHMEM,
DISCARDABLE_MEMORY_TYPE_EMULATED
};
types->assign(supported_types, supported_types + arraysize(supported_types));
}
......
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