1// Copyright 2014 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.
4
5#ifndef CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_
6#define CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_
7
8#include <map>
9
10#include "base/synchronization/lock.h"
11#include "cc/resources/shared_bitmap_manager.h"
12
13namespace cc {
14
15class TestSharedBitmapManager : public SharedBitmapManager {
16 public:
17  TestSharedBitmapManager();
18  virtual ~TestSharedBitmapManager();
19
20  virtual scoped_ptr<SharedBitmap> AllocateSharedBitmap(const gfx::Size& size)
21      OVERRIDE;
22
23  virtual scoped_ptr<SharedBitmap> GetSharedBitmapFromId(
24      const gfx::Size&,
25      const SharedBitmapId& id) OVERRIDE;
26
27  virtual scoped_ptr<SharedBitmap> GetBitmapForSharedMemory(
28      base::SharedMemory* memory) OVERRIDE;
29
30 private:
31  base::Lock lock_;
32  std::map<SharedBitmapId, base::SharedMemory*> bitmap_map_;
33};
34
35}  // namespace cc
36
37#endif  // CC_TEST_TEST_SHARED_BITMAP_MANAGER_H_
38