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 |
index 87385481f2ea784058ddaa9f922b80cc5ea77931..9ccc483a7f0f3469695e45eaebd665dfd7e1a5a5 100644 |
--- a/content/browser/renderer_host/renderer_frame_manager.h |
+++ b/content/browser/renderer_host/renderer_frame_manager.h |
@@ -11,6 +11,7 @@ |
#include <map> |
#include "base/macros.h" |
+#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" |
@@ -31,7 +32,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 { |
+class CONTENT_EXPORT RendererFrameManager : |
+ public base::MemoryCoordinatorClient { |
public: |
static RendererFrameManager* GetInstance(); |
@@ -53,23 +55,29 @@ class CONTENT_EXPORT RendererFrameManager { |
friend class RenderWidgetHostViewAuraTest; |
RendererFrameManager(); |
- ~RendererFrameManager(); |
+ ~RendererFrameManager() override; |
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); |
+ // base::MemoryCoordinatorClient implementation: |
+ void OnMemoryStateChange(base::MemoryState state) override; |
+ |
+ void PurgeMemory(int percentage); |
sadrul
2016/09/26 20:04:20
Non override before overrides.
hajimehoshi
2016/09/28 07:31:10
Done.
|
+ |
friend struct base::DefaultSingletonTraits<RendererFrameManager>; |
// Listens for system under pressure notifications and adjusts number of |
// cached frames accordingly. |
- base::MemoryPressureListener memory_pressure_listener_; |
+ std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
std::map<RendererFrameManagerClient*, size_t> locked_frames_; |
std::list<RendererFrameManagerClient*> unlocked_frames_; |
size_t max_number_of_saved_frames_; |
float max_handles_; |
+ base::MemoryState memory_state_; |
DISALLOW_COPY_AND_ASSIGN(RendererFrameManager); |
}; |