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

Unified Diff: chrome/browser/memory/oom_priority_manager.h

Issue 1332003002: Add option to disallow the discarding of a tab that was previously discarded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky@ and rkaplow@ comments. Created 5 years, 3 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
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/memory/oom_priority_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/memory/oom_priority_manager.h
diff --git a/chrome/browser/memory/oom_priority_manager.h b/chrome/browser/memory/oom_priority_manager.h
index 5401e61571fdfbdbd7f04fc51f8a2ea55ca64372..07b6f17170a90fc2b214088f2285ebd875e6bb81 100644
--- a/chrome/browser/memory/oom_priority_manager.h
+++ b/chrome/browser/memory/oom_priority_manager.h
@@ -53,7 +53,9 @@ class OomPriorityManager {
// See member comment.
bool recent_tab_discard() const { return recent_tab_discard_; }
- void Start();
+ // If |discard_once| is set, tabs that get discarded once will never get
+ // discarded again.
+ void Start(bool discard_once);
void Stop();
// Returns the list of the stats for all renderers. Must be called on the UI
@@ -113,6 +115,11 @@ class OomPriorityManager {
// that need to be run periodically (see comment in implementation).
void UpdateTimerCallback();
+ // Goes through a list of checks to see if a tab is allowed to be discarded by
+ // the automatic tab discarding mechanism. Note that this is not used when
+ // discarding a particular tab from about:discards.
+ bool CanDiscardTab(int64 target_web_contents_id) const;
+
static bool CompareTabStats(TabStats first, TabStats second);
// Called by the memory pressure listener when the memory pressure rises.
@@ -147,6 +154,9 @@ class OomPriorityManager {
// used for statistics normalized by usage.
bool recent_tab_discard_;
+ // Whether we ever only discard a tab once.
+ bool discard_once_;
+
#if defined(OS_CHROMEOS)
scoped_ptr<OomPriorityManagerDelegate> delegate_;
#endif
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/memory/oom_priority_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698