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

Unified 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, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/renderer_frame_manager.h
diff --git a/content/browser/renderer_host/renderer_frame_manager.h b/content/browser/renderer_host/renderer_frame_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..134e1ef6a0487a458e262c255c4a0ee1ec524b1d
--- /dev/null
+++ b/content/browser/renderer_host/renderer_frame_manager.h
@@ -0,0 +1,50 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_
+#define CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_
+
+#include <list>
+#include <set>
+
+#include "base/basictypes.h"
+#include "base/memory/singleton.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+class CONTENT_EXPORT RendererFrameManagerClient {
+ public:
+ virtual ~RendererFrameManagerClient() {}
+ virtual void EvictCurrentFrame() = 0;
+};
+
+class CONTENT_EXPORT RendererFrameManager {
+ public:
+ static RendererFrameManager* GetInstance();
+
+ void AddFrame(RendererFrameManagerClient*, bool visible);
+ void RemoveFrame(RendererFrameManagerClient*);
+ void SetFrameVisibility(RendererFrameManagerClient*, bool visible);
+
+ size_t max_number_of_saved_frames() const {
+ return max_number_of_saved_frames_;
+ }
+
+ private:
+ RendererFrameManager();
+ ~RendererFrameManager();
+ void CullHiddenFrames();
+ friend struct DefaultSingletonTraits<RendererFrameManager>;
+
+ std::set<RendererFrameManagerClient*> visible_frames_;
+ std::list<RendererFrameManagerClient*> hidden_frames_;
+ size_t max_number_of_saved_frames_;
+
+ DISALLOW_COPY_AND_ASSIGN(RendererFrameManager);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698