Landing Recent QUIC changes until 8/19/2015 17:00 UTC.
[chromium-blink-merge.git] / skia / ext / SkDiscardableMemory_chrome.h
blob1be4516be168b90648940b5dbb03f13747a29963
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"
11 namespace base {
12 class DiscardableMemory;
15 // This class implements the SkDiscardableMemory interface using
16 // base::DiscardableMemory.
17 class SK_API SkDiscardableMemoryChrome : public SkDiscardableMemory {
18 public:
19 ~SkDiscardableMemoryChrome() override;
21 // SkDiscardableMemory:
22 bool lock() override;
23 void* data() override;
24 void unlock() override;
26 private:
27 friend class SkDiscardableMemory;
29 SkDiscardableMemoryChrome(scoped_ptr<base::DiscardableMemory> memory);
31 scoped_ptr<base::DiscardableMemory> discardable_;
34 #endif // SKIA_EXT_SK_DISCARDABLE_MEMORY_CHROME_H_