OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 void AddFrame(RendererFrameManagerClient*, bool locked); | 27 void AddFrame(RendererFrameManagerClient*, bool locked); |
28 void RemoveFrame(RendererFrameManagerClient*); | 28 void RemoveFrame(RendererFrameManagerClient*); |
29 void LockFrame(RendererFrameManagerClient*); | 29 void LockFrame(RendererFrameManagerClient*); |
30 void UnlockFrame(RendererFrameManagerClient*); | 30 void UnlockFrame(RendererFrameManagerClient*); |
31 | 31 |
32 size_t max_number_of_saved_frames() const { | 32 size_t max_number_of_saved_frames() const { |
33 return max_number_of_saved_frames_; | 33 return max_number_of_saved_frames_; |
34 } | 34 } |
35 | 35 |
| 36 // For testing only |
| 37 void set_max_handles(float max_handles) { max_handles_ = max_handles; } |
| 38 |
36 private: | 39 private: |
37 RendererFrameManager(); | 40 RendererFrameManager(); |
38 ~RendererFrameManager(); | 41 ~RendererFrameManager(); |
39 void CullUnlockedFrames(); | 42 void CullUnlockedFrames(); |
40 | 43 |
41 friend struct DefaultSingletonTraits<RendererFrameManager>; | 44 friend struct DefaultSingletonTraits<RendererFrameManager>; |
42 | 45 |
43 std::map<RendererFrameManagerClient*, size_t> locked_frames_; | 46 std::map<RendererFrameManagerClient*, size_t> locked_frames_; |
44 std::list<RendererFrameManagerClient*> unlocked_frames_; | 47 std::list<RendererFrameManagerClient*> unlocked_frames_; |
45 size_t max_number_of_saved_frames_; | 48 size_t max_number_of_saved_frames_; |
| 49 float max_handles_; |
46 | 50 |
47 DISALLOW_COPY_AND_ASSIGN(RendererFrameManager); | 51 DISALLOW_COPY_AND_ASSIGN(RendererFrameManager); |
48 }; | 52 }; |
49 | 53 |
50 } // namespace content | 54 } // namespace content |
51 | 55 |
52 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_ | 56 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_ |
OLD | NEW |