diff options
author | reveman <reveman@chromium.org> | 2015-03-16 09:50:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-16 16:50:50 +0000 |
commit | ee5ad4b13cc36b7ee494bc2b04a356d73ad32e3a (patch) | |
tree | 064294442ce754c16b1edceb23f188badabfeaf7 /ash/test | |
parent | aa67d94128a91167e9d475fca1f1ba9100c85860 (diff) | |
download | chromium_src-ee5ad4b13cc36b7ee494bc2b04a356d73ad32e3a.zip chromium_src-ee5ad4b13cc36b7ee494bc2b04a356d73ad32e3a.tar.gz chromium_src-ee5ad4b13cc36b7ee494bc2b04a356d73ad32e3a.tar.bz2 |
base: Implement browser process support for discardable memory.
This implements support for in-process discardable
memory. Each in-process discardable memory instance is
associated with a discardable shared memory segment. This
is hopefully efficient enough with the limited use of
discardable memory in the browser process.
DiscardableSharedMemoryHeap can be used if this is not
enough.
This also moves the test implementation of the discardable
memory allocator into a TestDiscardableMemoryShmemAllocator
class and requires tests that use discardable memory to
explicitly use this test allocator. Browser tests uses the
real discardable memory allocator.
BUG=422953,463250
Review URL: https://codereview.chromium.org/1004043002
Cr-Commit-Position: refs/heads/master@{#320737}
Diffstat (limited to 'ash/test')
-rw-r--r-- | ash/test/test_suite.cc | 3 | ||||
-rw-r--r-- | ash/test/test_suite.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/ash/test/test_suite.cc b/ash/test/test_suite.cc index 1b7eb46..80d61f4 100644 --- a/ash/test/test_suite.cc +++ b/ash/test/test_suite.cc @@ -52,6 +52,9 @@ void AuraShellTestSuite::Initialize() { // output, it'll pass regardless of the system language. ui::ResourceBundle::InitSharedInstanceWithLocale( "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); + + base::DiscardableMemoryShmemAllocator::SetInstance( + &discardable_memory_allocator_); } void AuraShellTestSuite::Shutdown() { diff --git a/ash/test/test_suite.h b/ash/test/test_suite.h index 33fcd23..e2e0957 100644 --- a/ash/test/test_suite.h +++ b/ash/test/test_suite.h @@ -6,6 +6,7 @@ #define ASH_TEST_TEST_SUITE_H_ #include "base/compiler_specific.h" +#include "base/test/test_discardable_memory_shmem_allocator.h" #include "base/test/test_suite.h" #if defined(OS_WIN) @@ -29,6 +30,8 @@ class AuraShellTestSuite : public base::TestSuite { #if defined(OS_WIN) scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; #endif + + base::TestDiscardableMemoryShmemAllocator discardable_memory_allocator_; }; } // namespace test |