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_DELEGATED_FRAME_EVICTOR_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_EVICTOR_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_EVICTOR_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_EVICTOR_H_ |
7 | 7 |
8 #include "content/browser/renderer_host/renderer_frame_manager.h" | 8 #include "content/browser/renderer_host/renderer_frame_manager.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 class CONTENT_EXPORT DelegatedFrameEvictorClient { | 13 class CONTENT_EXPORT DelegatedFrameEvictorClient { |
14 public: | 14 public: |
15 virtual ~DelegatedFrameEvictorClient() {} | 15 virtual ~DelegatedFrameEvictorClient() {} |
16 virtual void EvictDelegatedFrame() = 0; | 16 virtual void EvictDelegatedFrame() = 0; |
17 }; | 17 }; |
18 | 18 |
19 class CONTENT_EXPORT DelegatedFrameEvictor : public RendererFrameManagerClient { | 19 class CONTENT_EXPORT DelegatedFrameEvictor : public RendererFrameManagerClient { |
20 public: | 20 public: |
21 // |client| must outlive |this|. | 21 // |client| must outlive |this|. |
22 explicit DelegatedFrameEvictor(DelegatedFrameEvictorClient* client); | 22 explicit DelegatedFrameEvictor(DelegatedFrameEvictorClient* client); |
23 virtual ~DelegatedFrameEvictor(); | 23 virtual ~DelegatedFrameEvictor(); |
24 | 24 |
25 void SwappedFrame(bool visible); | 25 void SwappedFrame(bool visible); |
26 void DiscardedFrame(); | 26 void DiscardedFrame(); |
27 void SetVisible(bool visible); | 27 void SetVisible(bool visible); |
28 void LockFrame(); | 28 void LockFrame(); |
29 void UnlockFrame(); | 29 void UnlockFrame(); |
| 30 bool HasFrame() { return has_frame_; } |
30 | 31 |
31 private: | 32 private: |
32 // RendererFrameManagerClient implementation. | 33 // RendererFrameManagerClient implementation. |
33 virtual void EvictCurrentFrame() OVERRIDE; | 34 virtual void EvictCurrentFrame() OVERRIDE; |
34 | 35 |
35 DelegatedFrameEvictorClient* client_; | 36 DelegatedFrameEvictorClient* client_; |
36 bool has_frame_; | 37 bool has_frame_; |
37 | 38 |
38 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameEvictor); | 39 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameEvictor); |
39 }; | 40 }; |
40 | 41 |
41 } // namespace content | 42 } // namespace content |
42 | 43 |
43 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_EVICTOR_H_ | 44 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_EVICTOR_H_ |
OLD | NEW |