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 | |
39 private: | 36 private: |
40 RendererFrameManager(); | 37 RendererFrameManager(); |
41 ~RendererFrameManager(); | 38 ~RendererFrameManager(); |
42 void CullUnlockedFrames(); | 39 void CullUnlockedFrames(); |
43 | 40 |
44 friend struct DefaultSingletonTraits<RendererFrameManager>; | 41 friend struct DefaultSingletonTraits<RendererFrameManager>; |
45 | 42 |
46 std::map<RendererFrameManagerClient*, size_t> locked_frames_; | 43 std::map<RendererFrameManagerClient*, size_t> locked_frames_; |
47 std::list<RendererFrameManagerClient*> unlocked_frames_; | 44 std::list<RendererFrameManagerClient*> unlocked_frames_; |
48 size_t max_number_of_saved_frames_; | 45 size_t max_number_of_saved_frames_; |
49 float max_handles_; | |
50 | 46 |
51 DISALLOW_COPY_AND_ASSIGN(RendererFrameManager); | 47 DISALLOW_COPY_AND_ASSIGN(RendererFrameManager); |
52 }; | 48 }; |
53 | 49 |
54 } // namespace content | 50 } // namespace content |
55 | 51 |
56 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_ | 52 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_ |
OLD | NEW |