Simplify ChildProcessLauncher
[chromium-blink-merge.git] / content / browser / renderer_host / delegated_frame_evictor.h
blob9e9f68a61add27bf05be4936c4048aec7dafff4b
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.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_EVICTOR_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_EVICTOR_H_
8 #include "content/browser/renderer_host/renderer_frame_manager.h"
9 #include "content/common/content_export.h"
11 namespace content {
13 class CONTENT_EXPORT DelegatedFrameEvictorClient {
14 public:
15 virtual ~DelegatedFrameEvictorClient() {}
16 virtual void EvictDelegatedFrame() = 0;
19 class CONTENT_EXPORT DelegatedFrameEvictor : public RendererFrameManagerClient {
20 public:
21 // |client| must outlive |this|.
22 explicit DelegatedFrameEvictor(DelegatedFrameEvictorClient* client);
23 ~DelegatedFrameEvictor() override;
25 void SwappedFrame(bool visible);
26 void DiscardedFrame();
27 void SetVisible(bool visible);
28 void LockFrame();
29 void UnlockFrame();
30 bool HasFrame() { return has_frame_; }
32 private:
33 // RendererFrameManagerClient implementation.
34 void EvictCurrentFrame() override;
36 DelegatedFrameEvictorClient* client_;
37 bool has_frame_;
38 bool visible_;
40 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameEvictor);
43 } // namespace content
45 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_EVICTOR_H_