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

Side by Side Diff: content/child/web_discardable_memory_impl.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 | « content/child/web_discardable_memory_impl.h ('k') | skia/ext/SkDiscardableMemory_chrome.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/child/web_discardable_memory_impl.h" 5 #include "content/child/web_discardable_memory_impl.h"
6 6
7 #include "base/memory/discardable_memory.h"
8 #include "base/memory/discardable_memory_allocator.h"
9
7 namespace content { 10 namespace content {
8 11
9 WebDiscardableMemoryImpl::~WebDiscardableMemoryImpl() {} 12 WebDiscardableMemoryImpl::~WebDiscardableMemoryImpl() {}
10 13
11 // static 14 // static
12 scoped_ptr<WebDiscardableMemoryImpl> 15 scoped_ptr<WebDiscardableMemoryImpl>
13 WebDiscardableMemoryImpl::CreateLockedMemory(size_t size) { 16 WebDiscardableMemoryImpl::CreateLockedMemory(size_t size) {
14 return make_scoped_ptr(new WebDiscardableMemoryImpl( 17 return make_scoped_ptr(new WebDiscardableMemoryImpl(
15 base::DiscardableMemory::CreateLockedMemory(size))); 18 base::DiscardableMemoryAllocator::GetInstance()
19 ->AllocateLockedDiscardableMemory(size)));
16 } 20 }
17 21
18 bool WebDiscardableMemoryImpl::lock() { 22 bool WebDiscardableMemoryImpl::lock() {
19 return discardable_->Lock(); 23 return discardable_->Lock();
20 } 24 }
21 25
22 void WebDiscardableMemoryImpl::unlock() { 26 void WebDiscardableMemoryImpl::unlock() {
23 discardable_->Unlock(); 27 discardable_->Unlock();
24 } 28 }
25 29
26 void* WebDiscardableMemoryImpl::data() { 30 void* WebDiscardableMemoryImpl::data() {
27 return discardable_->Memory(); 31 return discardable_->Memory();
28 } 32 }
29 33
30 WebDiscardableMemoryImpl::WebDiscardableMemoryImpl( 34 WebDiscardableMemoryImpl::WebDiscardableMemoryImpl(
31 scoped_ptr<base::DiscardableMemory> memory) 35 scoped_ptr<base::DiscardableMemory> memory)
32 : discardable_(memory.Pass()) { 36 : discardable_(memory.Pass()) {
33 } 37 }
34 38
35 } // namespace content 39 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_discardable_memory_impl.h ('k') | skia/ext/SkDiscardableMemory_chrome.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698