Chromium Code Reviews| Index: components/display_compositor/frame_evictor.h |
| diff --git a/components/display_compositor/frame_evictor.h b/components/display_compositor/frame_evictor.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9e3c49ce5b69c3c878aa222b6a89e326fc72f5c0 |
| --- /dev/null |
| +++ b/components/display_compositor/frame_evictor.h |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
|
Fady Samuel
2017/04/12 03:17:02
nit: 2017
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_DISPLAY_COMPOSITOR_FRAME_EVICTOR_H_ |
| +#define COMPONENTS_DISPLAY_COMPOSITOR_FRAME_EVICTOR_H_ |
| + |
| +#include "base/macros.h" |
| +#include "components/display_compositor/display_compositor_export.h" |
| +#include "components/display_compositor/frame_eviction_manager.h" |
| + |
| +namespace display_compositor { |
| + |
| +class DISPLAY_COMPOSITOR_EXPORT FrameEvictorClient { |
| + public: |
| + virtual ~FrameEvictorClient() {} |
| + virtual void EvictDelegatedFrame() = 0; |
| +}; |
| + |
| +class DISPLAY_COMPOSITOR_EXPORT FrameEvictor |
| + : public FrameEvictionManagerClient { |
| + public: |
| + // |client| must outlive |this|. |
| + explicit FrameEvictor(FrameEvictorClient* client); |
| + ~FrameEvictor() override; |
| + |
| + void SwappedFrame(bool visible); |
| + void DiscardedFrame(); |
| + void SetVisible(bool visible); |
| + void LockFrame(); |
| + void UnlockFrame(); |
| + bool HasFrame() { return has_frame_; } |
| + |
| + private: |
| + // FrameEvictionManagerClient implementation. |
| + void EvictCurrentFrame() override; |
| + |
| + FrameEvictorClient* client_; |
| + bool has_frame_; |
| + bool visible_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(FrameEvictor); |
| +}; |
| + |
| +} // namespace display_compositor |
| + |
| +#endif // COMPONENTS_DISPLAY_COMPOSITOR_FRAME_EVICTOR_H_ |