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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 1257543004: Add oom tab killing and the about:discards page on linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@memoryPressureOnLinux
Patch Set: Created 5 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
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 #include "chrome/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 three_d_observer_.reset(new ThreeDAPIObserver()); 1117 three_d_observer_.reset(new ThreeDAPIObserver());
1118 1118
1119 // Start the out-of-memory priority manager here so that we give the most 1119 // Start the out-of-memory priority manager here so that we give the most
1120 // amount of time for the other services to start up before we start 1120 // amount of time for the other services to start up before we start
1121 // adjusting the oom priority. 1121 // adjusting the oom priority.
1122 // 1122 //
1123 // On CrOS, it is always enabled. On other platforms, it's behind a flag for 1123 // On CrOS, it is always enabled. On other platforms, it's behind a flag for
1124 // now. 1124 // now.
1125 #if defined(OS_CHROMEOS) 1125 #if defined(OS_CHROMEOS)
1126 g_browser_process->GetOomPriorityManager()->Start(); 1126 g_browser_process->GetOomPriorityManager()->Start();
1127 #elif defined(OS_WIN) 1127 #elif defined(OS_WIN) || defined(OS_LINUX)
1128 if (parsed_command_line().HasSwitch(switches::kEnableTabDiscarding)) 1128 if (parsed_command_line().HasSwitch(switches::kEnableTabDiscarding))
1129 g_browser_process->GetOomPriorityManager()->Start(); 1129 g_browser_process->GetOomPriorityManager()->Start();
1130 #endif 1130 #endif
1131 } 1131 }
1132 1132
1133 void ChromeBrowserMainParts::PostBrowserStart() { 1133 void ChromeBrowserMainParts::PostBrowserStart() {
1134 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostBrowserStart"); 1134 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostBrowserStart");
1135 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 1135 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
1136 chrome_extra_parts_[i]->PostBrowserStart(); 1136 chrome_extra_parts_[i]->PostBrowserStart();
1137 #if !defined(OS_ANDROID) 1137 #if !defined(OS_ANDROID)
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 chromeos::CrosSettings::Shutdown(); 1800 chromeos::CrosSettings::Shutdown();
1801 #endif // defined(OS_CHROMEOS) 1801 #endif // defined(OS_CHROMEOS)
1802 #endif // defined(OS_ANDROID) 1802 #endif // defined(OS_ANDROID)
1803 } 1803 }
1804 1804
1805 // Public members: 1805 // Public members:
1806 1806
1807 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1807 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1808 chrome_extra_parts_.push_back(parts); 1808 chrome_extra_parts_.push_back(parts);
1809 } 1809 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/memory/oom_priority_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698