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