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

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: remove unused sudden_termination flag 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/oom_priority_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 base::TimeTicks last_selected; 70 base::TimeTicks last_selected;
71 base::ProcessHandle renderer_handle; 71 base::ProcessHandle renderer_handle;
72 string16 title; 72 string16 title;
73 int64 tab_contents_id; // unique ID per WebContents 73 int64 tab_contents_id; // unique ID per WebContents
74 }; 74 };
75 typedef std::vector<TabStats> TabStatsList; 75 typedef std::vector<TabStats> TabStatsList;
76 76
77 // Discards a tab with the given unique ID. Returns true if discard occurred. 77 // Discards a tab with the given unique ID. Returns true if discard occurred.
78 bool DiscardTabById(int64 target_web_contents_id); 78 bool DiscardTabById(int64 target_web_contents_id);
79 79
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 // Number of times we have discarded a tab, for statistics. 134 // Number of times we have discarded a tab, for statistics.
135 int discard_count_; 135 int discard_count_;
136 136
137 DISALLOW_COPY_AND_ASSIGN(OomPriorityManager); 137 DISALLOW_COPY_AND_ASSIGN(OomPriorityManager);
138 }; 138 };
139 139
140 } // namespace chrome 140 } // namespace chrome
141 141
142 #endif // CHROME_BROWSER_CHROMEOS_OOM_PRIORITY_MANAGER_H_ 142 #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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698