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

Unified Diff: content/public/browser/memory_coordinator_delegate.h

Issue 2518653002: memory coordinator: Set variation parameters if available (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/public/browser/memory_coordinator_delegate.h
diff --git a/content/public/browser/memory_coordinator_delegate.h b/content/public/browser/memory_coordinator_delegate.h
index 32758d964fa907e03dd97b30652e92385e700fa8..0f2609483289ee90d9a0b998a4063091c459fdd2 100644
--- a/content/public/browser/memory_coordinator_delegate.h
+++ b/content/public/browser/memory_coordinator_delegate.h
@@ -9,6 +9,34 @@
namespace content {
+// Parameters for memory coordinator V0.
+struct MemoryCoordinatorV0Params {
bashi 2016/11/18 20:07:27 Exposing the details is bad, but I couldn't find a
+ // The median size of a renderer on the current platform. This is used to
+ // convert the amount of free memory to an expected number of new renderers
+ // that could be started before hitting critical memory pressure.
+ int expected_renderer_size;
+ // When in a NORMAL state and the potential number of new renderers drops
+ // below this level, the coordinator will transition to a THROTTLED state.
+ int new_renderers_until_throttled;
+ // When in a NORMAL/THROTTLED state and the potential number of new renderers
+ // drops below this level, the coordinator will transition to a SUSPENDED
+ // state.
+ int new_renderers_until_suspended;
+ // When in a THROTTLED/SUSPENDED state and the potential number of new
+ // renderers rises above this level, the coordinator will transition to a
+ // NORMAL state.
+ int new_renderers_back_to_normal;
+ // When in a SUSPENDED state and the potential number of new renderers rises
+ // above this level, the coordinator will transition to a SUSPENDED state.
+ int new_renderers_back_to_throttled;
+ // The memory coordinator stays in the same state at least this duration even
+ // when there are considerable changes in the amount of free memory to prevent
+ // thrashing.
+ base::TimeDelta minimum_transition_period;
+ // The interval of checking the amount of free memory.
+ base::TimeDelta monitoring_interval;
+};
+
// A delegate class which is used by the memory coordinator.
class CONTENT_EXPORT MemoryCoordinatorDelegate {
public:
@@ -16,6 +44,9 @@ class CONTENT_EXPORT MemoryCoordinatorDelegate {
// Returns true when a given backgrounded renderer process can be suspended.
virtual bool CanSuspendBackgroundedRenderer(int render_process_id) = 0;
+
+ // Overrides memory coordinator parameters if variations are available.
+ virtual void OverrideParameters(MemoryCoordinatorV0Params* params) = 0;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698