| Index: chrome/browser/chromeos/memory/oom_priority_manager.h
|
| diff --git a/chrome/browser/chromeos/memory/oom_priority_manager.h b/chrome/browser/chromeos/memory/oom_priority_manager.h
|
| index 2b988191b68c3edc3db8429d04812fe205654361..a6cf70495312c6b878b9417c9f724176a1d09fb5 100644
|
| --- a/chrome/browser/chromeos/memory/oom_priority_manager.h
|
| +++ b/chrome/browser/chromeos/memory/oom_priority_manager.h
|
| @@ -42,6 +42,9 @@ class OomPriorityManager : public content::NotificationObserver {
|
| // Number of discard events since Chrome started.
|
| int discard_count() const { return discard_count_; }
|
|
|
| + // See member comment.
|
| + bool recent_tab_discard() const { return recent_tab_discard_; }
|
| +
|
| void Start();
|
| void Stop();
|
|
|
| @@ -91,6 +94,10 @@ class OomPriorityManager : public content::NotificationObserver {
|
| // to manually test the system.
|
| void RecordDiscardStatistics();
|
|
|
| + // Record whether we ran out of memory during a recent time interval.
|
| + // This allows us to normalize low memory statistics versus usage.
|
| + void RecordRecentTabDiscard();
|
| +
|
| // Purges data structures in the browser that can be easily recomputed.
|
| void PurgeBrowserMemory();
|
|
|
| @@ -119,6 +126,7 @@ class OomPriorityManager : public content::NotificationObserver {
|
|
|
| base::RepeatingTimer<OomPriorityManager> timer_;
|
| base::OneShotTimer<OomPriorityManager> focus_tab_score_adjust_timer_;
|
| + base::RepeatingTimer<OomPriorityManager> recent_tab_discard_timer_;
|
| content::NotificationRegistrar registrar_;
|
|
|
| // This lock is for pid_to_oom_score_ and focus_tab_pid_.
|
| @@ -146,6 +154,10 @@ class OomPriorityManager : public content::NotificationObserver {
|
| // Number of times we have discarded a tab, for statistics.
|
| int discard_count_;
|
|
|
| + // Whether a tab discard event has occurred during the last time interval,
|
| + // used for statistics normalized by usage.
|
| + bool recent_tab_discard_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(OomPriorityManager);
|
| };
|
|
|
|
|