chromium/third_party/skia/src/lazy/SkDiscardableMemoryPool.cpp

/*
 * Copyright 2013 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "include/private/base/SkMalloc.h"
#include "include/private/base/SkMutex.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/chromium/SkDiscardableMemory.h"
#include "src/base/SkTInternalLList.h"
#include "src/lazy/SkDiscardableMemoryPool.h"

usingnamespaceskia_private;

// Note:
// A PoolDiscardableMemory is memory that is counted in a pool.
// A DiscardableMemoryPool is a pool of PoolDiscardableMemorys.

namespace {

class PoolDiscardableMemory;

/**
 *  This non-global pool can be used for unit tests to verify that the
 *  pool works.
 */
class DiscardableMemoryPool : public SkDiscardableMemoryPool {};

/**
 *  A PoolDiscardableMemory is a SkDiscardableMemory that relies on
 *  a DiscardableMemoryPool object to manage the memory.
 */
class PoolDiscardableMemory : public SkDiscardableMemory {};

PoolDiscardableMemory::PoolDiscardableMemory(sk_sp<DiscardableMemoryPool> pool,
                                             UniqueVoidPtr pointer,
                                             size_t bytes)
        :{}

PoolDiscardableMemory::~PoolDiscardableMemory() {}

bool PoolDiscardableMemory::lock() {}

void* PoolDiscardableMemory::data() {}

void PoolDiscardableMemory::unlock() {}

////////////////////////////////////////////////////////////////////////////////

DiscardableMemoryPool::DiscardableMemoryPool(size_t budget)
    :{}
DiscardableMemoryPool::~DiscardableMemoryPool() {}

void DiscardableMemoryPool::dumpDownTo(size_t budget) {}

std::unique_ptr<SkDiscardableMemory> DiscardableMemoryPool::make(size_t bytes) {}

void DiscardableMemoryPool::removeFromPool(PoolDiscardableMemory* dm) {}

bool DiscardableMemoryPool::lock(PoolDiscardableMemory* dm) {}

void DiscardableMemoryPool::unlock(PoolDiscardableMemory* dm) {}

size_t DiscardableMemoryPool::getRAMUsed() {}
void DiscardableMemoryPool::setRAMBudget(size_t budget) {}
void DiscardableMemoryPool::dumpPool() {}

}  // namespace

sk_sp<SkDiscardableMemoryPool> SkDiscardableMemoryPool::Make(size_t size) {}

SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool() {}