Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: base/memory/discardable_memory_linux.cc

Issue 111713008: base: Refactor DiscardableMemoryProvider to build and be tested on all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix native_discardable_memory on ios. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 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
10 bool DiscardableMemory::SupportedNatively() {
11 return false;
12 }
13
14 // static
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
26 bool DiscardableMemory::PurgeForTestingSupported() {
27 return true;
28 }
29
30 // static
31 void DiscardableMemory::PurgeForTesting() {
32 internal::DiscardableMemoryEmulated::PurgeForTesting();
33 }
34
35 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698