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.
5 #ifndef SKIA_EXT_SK_DISCARDABLE_MEMORY_CHROME_H_
6 #define SKIA_EXT_SK_DISCARDABLE_MEMORY_CHROME_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "third_party/skia/src/core/SkDiscardableMemory.h"
12 class DiscardableMemory
;
14 namespace trace_event
{
15 class MemoryAllocatorDump
;
16 class ProcessMemoryDump
;
21 // This class implements the SkDiscardableMemory interface using
22 // base::DiscardableMemory.
23 class SK_API SkDiscardableMemoryChrome
: public SkDiscardableMemory
{
25 ~SkDiscardableMemoryChrome() override
;
27 // SkDiscardableMemory:
29 void* data() override
;
30 void unlock() override
;
32 base::trace_event::MemoryAllocatorDump
* CreateMemoryAllocatorDump(
34 base::trace_event::ProcessMemoryDump
* pmd
) const;
37 friend class SkDiscardableMemory
;
39 SkDiscardableMemoryChrome(scoped_ptr
<base::DiscardableMemory
> memory
);
41 scoped_ptr
<base::DiscardableMemory
> discardable_
;
44 #endif // SKIA_EXT_SK_DISCARDABLE_MEMORY_CHROME_H_