• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "base/memory/discardable_memory_emulated.h"
6 
7 namespace base {
8 
9 // static
SupportedNatively()10 bool DiscardableMemory::SupportedNatively() {
11   return false;
12 }
13 
14 // static
CreateLockedMemory(size_t size)15 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemory(
16     size_t size) {
17   scoped_ptr<internal::DiscardableMemoryEmulated> memory(
18       new internal::DiscardableMemoryEmulated(size));
19   if (!memory->Initialize())
20     return scoped_ptr<DiscardableMemory>();
21 
22   return memory.PassAs<DiscardableMemory>();
23 }
24 
25 // static
PurgeForTestingSupported()26 bool DiscardableMemory::PurgeForTestingSupported() {
27   return true;
28 }
29 
30 // static
PurgeForTesting()31 void DiscardableMemory::PurgeForTesting() {
32   internal::DiscardableMemoryEmulated::PurgeForTesting();
33 }
34 
35 }  // namespace base
36