Update ASan/Android runtime and setup script to LLVM r200682.
[chromium-blink-merge.git] / content / browser / renderer_host / renderer_frame_manager.h
blob8b72a65939cdbaf799c3f34e861cd881fe5aeb9b
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 CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_
8 #include <list>
9 #include <map>
11 #include "base/basictypes.h"
12 #include "base/memory/singleton.h"
13 #include "content/common/content_export.h"
15 namespace content {
17 class CONTENT_EXPORT RendererFrameManagerClient {
18 public:
19 virtual ~RendererFrameManagerClient() {}
20 virtual void EvictCurrentFrame() = 0;
23 class CONTENT_EXPORT RendererFrameManager {
24 public:
25 static RendererFrameManager* GetInstance();
27 void AddFrame(RendererFrameManagerClient*, bool locked);
28 void RemoveFrame(RendererFrameManagerClient*);
29 void LockFrame(RendererFrameManagerClient*);
30 void UnlockFrame(RendererFrameManagerClient*);
32 size_t max_number_of_saved_frames() const {
33 return max_number_of_saved_frames_;
36 private:
37 RendererFrameManager();
38 ~RendererFrameManager();
39 void CullUnlockedFrames();
41 friend struct DefaultSingletonTraits<RendererFrameManager>;
43 std::map<RendererFrameManagerClient*, size_t> locked_frames_;
44 std::list<RendererFrameManagerClient*> unlocked_frames_;
45 size_t max_number_of_saved_frames_;
47 DISALLOW_COPY_AND_ASSIGN(RendererFrameManager);
50 } // namespace content
52 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_