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

Side by Side Diff: chrome/browser/chromeos/oom_priority_manager.h

Issue 10860023: cros: Protect app windows from out-of-memory kills (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_OOM_PRIORITY_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_OOM_PRIORITY_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_OOM_PRIORITY_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_OOM_PRIORITY_MANAGER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Tab discard happens sometime later, as collecting the statistics touches 56 // Tab discard happens sometime later, as collecting the statistics touches
57 // multiple threads and takes time. 57 // multiple threads and takes time.
58 void LogMemoryAndDiscardTab(); 58 void LogMemoryAndDiscardTab();
59 59
60 private: 60 private:
61 FRIEND_TEST_ALL_PREFIXES(OomPriorityManagerTest, Comparator); 61 FRIEND_TEST_ALL_PREFIXES(OomPriorityManagerTest, Comparator);
62 62
63 struct TabStats { 63 struct TabStats {
64 TabStats(); 64 TabStats();
65 ~TabStats(); 65 ~TabStats();
66 bool is_app; // browser window is an app
66 bool is_pinned; 67 bool is_pinned;
67 bool is_selected; // selected in the currently active browser window 68 bool is_selected; // selected in the currently active browser window
68 bool is_discarded; 69 bool is_discarded;
69 bool sudden_termination_allowed; 70 bool sudden_termination_allowed;
70 base::TimeTicks last_selected; 71 base::TimeTicks last_selected;
71 base::ProcessHandle renderer_handle; 72 base::ProcessHandle renderer_handle;
72 string16 title; 73 string16 title;
73 int64 tab_contents_id; // unique ID per WebContents 74 int64 tab_contents_id; // unique ID per WebContents
74 }; 75 };
75 typedef std::vector<TabStats> TabStatsList; 76 typedef std::vector<TabStats> TabStatsList;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 134
134 // Number of times we have discarded a tab, for statistics. 135 // Number of times we have discarded a tab, for statistics.
135 int discard_count_; 136 int discard_count_;
136 137
137 DISALLOW_COPY_AND_ASSIGN(OomPriorityManager); 138 DISALLOW_COPY_AND_ASSIGN(OomPriorityManager);
138 }; 139 };
139 140
140 } // namespace chrome 141 } // namespace chrome
141 142
142 #endif // CHROME_BROWSER_CHROMEOS_OOM_PRIORITY_MANAGER_H_ 143 #endif // CHROME_BROWSER_CHROMEOS_OOM_PRIORITY_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/oom_priority_manager.cc » ('j') | chrome/browser/chromeos/oom_priority_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698