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

Unified Diff: content/browser/memory/memory_coordinator_impl.h

Issue 2735993002: memory_coordinator: Discard tabs under critical memory condition (Closed)
Patch Set: Created 3 years, 9 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/memory/memory_coordinator_impl.h
diff --git a/content/browser/memory/memory_coordinator_impl.h b/content/browser/memory/memory_coordinator_impl.h
index 4b63fb4cc38d88fafcf566aba4e8a951b7e1c36e..f22767be172e94f6060a1a4597acbf094290388e 100644
--- a/content/browser/memory/memory_coordinator_impl.h
+++ b/content/browser/memory/memory_coordinator_impl.h
@@ -108,9 +108,6 @@ class CONTENT_EXPORT MemoryCoordinatorImpl : public base::MemoryCoordinator,
// like purging memory and memory state changes.
void UpdateConditionIfNeeded(MemoryCondition condition);
- // Asks the delegate to discard a tab.
- void DiscardTab();
-
protected:
// Returns the RenderProcessHost which is correspond to the given id.
// Returns nullptr if there is no corresponding RenderProcessHost.
@@ -193,11 +190,17 @@ class CONTENT_EXPORT MemoryCoordinatorImpl : public base::MemoryCoordinator,
// Notifies a state change to child processes.
void NotifyStateToChildren(MemoryState state);
+ // Asks the delegate to discard a tab.
+ void DiscardTab();
+
std::unique_ptr<MemoryCoordinatorDelegate> delegate_;
std::unique_ptr<MemoryMonitor> memory_monitor_;
std::unique_ptr<MemoryConditionObserver> condition_observer_;
NotificationRegistrar notification_registrar_;
+ base::Closure tab_discarding_closure_;
+ base::TimeDelta tab_discarding_interval_;
+
// The current memory condition.
MemoryCondition memory_condition_ = MemoryCondition::NORMAL;

Powered by Google App Engine
This is Rietveld 408576698