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

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

Issue 1319473003: [tracing] Add SkResourceCache statistics to chrome://tracing (chrome side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@discardable_objdumps
Patch Set: Mac build fix. Created 5 years, 3 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') | skia/ext/SkTraceMemoryDump_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 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" 7 #include "base/memory/discardable_memory.h"
8 #include "base/memory/discardable_memory_allocator.h" 8 #include "base/memory/discardable_memory_allocator.h"
9 9
10 SkDiscardableMemoryChrome::~SkDiscardableMemoryChrome() {} 10 SkDiscardableMemoryChrome::~SkDiscardableMemoryChrome() {}
11 11
12 bool SkDiscardableMemoryChrome::lock() { 12 bool SkDiscardableMemoryChrome::lock() {
13 return discardable_->Lock(); 13 return discardable_->Lock();
14 } 14 }
15 15
16 void* SkDiscardableMemoryChrome::data() { 16 void* SkDiscardableMemoryChrome::data() {
17 return discardable_->data(); 17 return discardable_->data();
18 } 18 }
19 19
20 void SkDiscardableMemoryChrome::unlock() { 20 void SkDiscardableMemoryChrome::unlock() {
21 discardable_->Unlock(); 21 discardable_->Unlock();
22 } 22 }
23 23
24 SkDiscardableMemoryChrome::SkDiscardableMemoryChrome( 24 SkDiscardableMemoryChrome::SkDiscardableMemoryChrome(
25 scoped_ptr<base::DiscardableMemory> memory) 25 scoped_ptr<base::DiscardableMemory> memory)
26 : discardable_(memory.Pass()) { 26 : discardable_(memory.Pass()) {
27 } 27 }
28 28
29 base::trace_event::MemoryAllocatorDump*
30 SkDiscardableMemoryChrome::CreateMemoryAllocatorDump(
31 const char* name,
32 base::trace_event::ProcessMemoryDump* pmd) const {
33 return discardable_->CreateMemoryAllocatorDump(name, pmd);
34 }
35
29 SkDiscardableMemory* SkDiscardableMemory::Create(size_t bytes) { 36 SkDiscardableMemory* SkDiscardableMemory::Create(size_t bytes) {
30 return new SkDiscardableMemoryChrome( 37 return new SkDiscardableMemoryChrome(
31 base::DiscardableMemoryAllocator::GetInstance() 38 base::DiscardableMemoryAllocator::GetInstance()
32 ->AllocateLockedDiscardableMemory(bytes)); 39 ->AllocateLockedDiscardableMemory(bytes));
33 } 40 }
OLDNEW
« no previous file with comments | « skia/ext/SkDiscardableMemory_chrome.h ('k') | skia/ext/SkTraceMemoryDump_chrome.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698