#ifndef CC_RESOURCES_TEXTURE_MAILBOX_DELETER_H_
#define CC_RESOURCES_TEXTURE_MAILBOX_DELETER_H_
#include "base/memory/weak_ptr.h"
#include "cc/base/cc_export.h"
#include "cc/base/scoped_ptr_vector.h"
namespace base {
class SingleThreadTaskRunner;
}
namespace cc {
class ContextProvider;
class SingleReleaseCallback;
class CC_EXPORT TextureMailboxDeleter {
public:
explicit TextureMailboxDeleter(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
~TextureMailboxDeleter();
scoped_ptr<SingleReleaseCallback> GetReleaseCallback(
const scoped_refptr<ContextProvider>& context_provider,
unsigned texture_id);
private:
void RunDeleteTextureOnImplThread(SingleReleaseCallback* impl_callback,
uint32 sync_point,
bool is_lost);
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_;
ScopedPtrVector<SingleReleaseCallback> impl_callbacks_;
base::WeakPtrFactory<TextureMailboxDeleter> weak_ptr_factory_;
};
}
#endif