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 /ui/message_center | |
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 'ui/message_center')
-rw-r--r-- | ui/message_center/test/run_all_unittests.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/message_center/test/run_all_unittests.cc b/ui/message_center/test/run_all_unittests.cc index fa53d67..b0cc026 100644 --- a/ui/message_center/test/run_all_unittests.cc +++ b/ui/message_center/test/run_all_unittests.cc @@ -7,6 +7,7 @@ #include "base/compiler_specific.h" #include "base/path_service.h" #include "base/test/launcher/unit_test_launcher.h" +#include "base/test/test_discardable_memory_shmem_allocator.h" #include "base/test/test_suite.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/resource/resource_bundle.h" @@ -37,6 +38,9 @@ class MessageCenterTestSuite : public base::TestSuite { base::FilePath ui_test_pak_path; ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); + + base::DiscardableMemoryShmemAllocator::SetInstance( + &discardable_memory_allocator_); } void Shutdown() override { @@ -45,6 +49,8 @@ class MessageCenterTestSuite : public base::TestSuite { } private: + base::TestDiscardableMemoryShmemAllocator discardable_memory_allocator_; + DISALLOW_COPY_AND_ASSIGN(MessageCenterTestSuite); }; |