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

Unified Diff: components/display_compositor/renderer_frame_manager.h

Issue 2811083002: Move frame eviction into components (Closed)
Patch Set: Created 3 years, 8 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: components/display_compositor/renderer_frame_manager.h
diff --git a/content/browser/renderer_host/renderer_frame_manager.h b/components/display_compositor/renderer_frame_manager.h
similarity index 83%
rename from content/browser/renderer_host/renderer_frame_manager.h
rename to components/display_compositor/renderer_frame_manager.h
index b8600d356efa7dcaaabd4144b27aa1750c53c181..209f8c39d7c30d68681e35be2c3519d2214d5275 100644
--- a/content/browser/renderer_host/renderer_frame_manager.h
+++ b/components/display_compositor/renderer_frame_manager.h
@@ -2,8 +2,8 @@
// 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_
+#ifndef COMPONENTS_DISPLAY_COMPOSITOR_RENDERER_FRAME_MANAGER_H_
+#define COMPONENTS_DISPLAY_COMPOSITOR_RENDERER_FRAME_MANAGER_H_
#include <stddef.h>
@@ -14,13 +14,11 @@
#include "base/memory/memory_coordinator_client.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/memory/singleton.h"
-#include "content/common/content_export.h"
+#include "components/display_compositor/display_compositor_export.h"
-namespace content {
+namespace display_compositor {
-class RenderWidgetHostViewAuraTest;
-
-class CONTENT_EXPORT RendererFrameManagerClient {
+class DISPLAY_COMPOSITOR_EXPORT RendererFrameManagerClient {
public:
virtual ~RendererFrameManagerClient() {}
virtual void EvictCurrentFrame() = 0;
@@ -32,8 +30,8 @@ class CONTENT_EXPORT RendererFrameManagerClient {
// between a small set of tabs faster. The limit is a soft limit, because
// clients can lock their frame to prevent it from being discarded, e.g. if the
// tab is visible, or while capturing a screenshot.
-class CONTENT_EXPORT RendererFrameManager :
- public base::MemoryCoordinatorClient {
+class DISPLAY_COMPOSITOR_EXPORT RendererFrameManager
Saman Sami 2017/04/11 14:58:24 I think this class should have a more general name
xing.xu 2017/04/14 03:01:29 Done.
+ : public base::MemoryCoordinatorClient {
public:
static RendererFrameManager* GetInstance();
@@ -50,10 +48,12 @@ class CONTENT_EXPORT RendererFrameManager :
}
void set_max_handles(float max_handles) { max_handles_ = max_handles; }
- private:
+ // React on memory pressure events to adjust the number of cached frames.
// Please remove when crbug.com/443824 has been fixed.
- friend class RenderWidgetHostViewAuraTest;
+ void OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
+ private:
RendererFrameManager();
~RendererFrameManager() override;
@@ -62,10 +62,6 @@ class CONTENT_EXPORT RendererFrameManager :
void CullUnlockedFrames(size_t saved_frame_limit);
- // React on memory pressure events to adjust the number of cached frames.
- void OnMemoryPressure(
- base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
-
void PurgeMemory(int percentage);
friend struct base::DefaultSingletonTraits<RendererFrameManager>;
@@ -82,6 +78,6 @@ class CONTENT_EXPORT RendererFrameManager :
DISALLOW_COPY_AND_ASSIGN(RendererFrameManager);
};
-} // namespace content
+} // namespace display_compositor
-#endif // CONTENT_BROWSER_RENDERER_HOST_RENDERER_FRAME_MANAGER_H_
+#endif // COMPONENTS_DISPLAY_COMPOSITOR_RENDERER_FRAME_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698