Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: content/browser/renderer_host/renderer_frame_manager.h

Issue 43193002: Aura/ÜC: Drop frames on background tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CONTENT_EXPORT Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_RENDERER_FRAME_MANAGER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_
7
8 #include <list>
9 #include <set>
10
11 #include "base/basictypes.h"
12 #include "base/memory/singleton.h"
13 #include "content/common/content_export.h"
14
15 namespace content {
16
17 class CONTENT_EXPORT RendererFrameManagerClient {
18 public:
19 virtual ~RendererFrameManagerClient() {}
20 virtual void EvictCurrentFrame() = 0;
21 };
22
23 class CONTENT_EXPORT RendererFrameManager {
24 public:
25 static RendererFrameManager* GetInstance();
26
27 void AddFrame(RendererFrameManagerClient*, bool visible);
28 void RemoveFrame(RendererFrameManagerClient*);
29 void SetFrameVisibility(RendererFrameManagerClient*, bool visible);
30
31 size_t max_number_of_saved_frames() const {
32 return max_number_of_saved_frames_;
33 }
34
35 private:
36 RendererFrameManager();
37 ~RendererFrameManager();
38 void CullHiddenFrames();
39 friend struct DefaultSingletonTraits<RendererFrameManager>;
40
41 std::set<RendererFrameManagerClient*> visible_frames_;
42 std::list<RendererFrameManagerClient*> hidden_frames_;
43 size_t max_number_of_saved_frames_;
44
45 DISALLOW_COPY_AND_ASSIGN(RendererFrameManager);
46 };
47
48 } // namespace content
49
50 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698