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

Side by Side Diff: skia/ext/SkDiscardableMemory_chrome.cc

Issue 1013373002: base: Remove DiscardableMemory::CreateLockedMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win build issue Created 5 years, 9 months 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
« no previous file with comments | « skia/ext/SkDiscardableMemory_chrome.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "SkDiscardableMemory_chrome.h" 5 #include "SkDiscardableMemory_chrome.h"
6 6
7 #include "base/memory/discardable_memory.h"
8 #include "base/memory/discardable_memory_allocator.h"
9
7 SkDiscardableMemoryChrome::~SkDiscardableMemoryChrome() {} 10 SkDiscardableMemoryChrome::~SkDiscardableMemoryChrome() {}
8 11
9 bool SkDiscardableMemoryChrome::lock() { 12 bool SkDiscardableMemoryChrome::lock() {
10 return discardable_->Lock(); 13 return discardable_->Lock();
11 } 14 }
12 15
13 void* SkDiscardableMemoryChrome::data() { 16 void* SkDiscardableMemoryChrome::data() {
14 return discardable_->Memory(); 17 return discardable_->Memory();
15 } 18 }
16 19
17 void SkDiscardableMemoryChrome::unlock() { 20 void SkDiscardableMemoryChrome::unlock() {
18 discardable_->Unlock(); 21 discardable_->Unlock();
19 } 22 }
20 23
21 SkDiscardableMemoryChrome::SkDiscardableMemoryChrome( 24 SkDiscardableMemoryChrome::SkDiscardableMemoryChrome(
22 scoped_ptr<base::DiscardableMemory> memory) 25 scoped_ptr<base::DiscardableMemory> memory)
23 : discardable_(memory.Pass()) { 26 : discardable_(memory.Pass()) {
24 } 27 }
25 28
26 SkDiscardableMemory* SkDiscardableMemory::Create(size_t bytes) { 29 SkDiscardableMemory* SkDiscardableMemory::Create(size_t bytes) {
27 return new SkDiscardableMemoryChrome( 30 return new SkDiscardableMemoryChrome(
28 base::DiscardableMemory::CreateLockedMemory(bytes)); 31 base::DiscardableMemoryAllocator::GetInstance()
32 ->AllocateLockedDiscardableMemory(bytes));
29 } 33 }
OLDNEW
« no previous file with comments | « skia/ext/SkDiscardableMemory_chrome.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698