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

Side by Side Diff: chrome/browser/browser_process_impl.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, 5 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
« no previous file with comments | « chrome/browser/browser_process_impl.h ('k') | chrome/browser/chrome_browser_main.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 #include "chrome/browser/browser_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 #endif 140 #endif
141 141
142 #if defined(ENABLE_PLUGIN_INSTALLATION) 142 #if defined(ENABLE_PLUGIN_INSTALLATION)
143 #include "chrome/browser/plugins/plugins_resource_service.h" 143 #include "chrome/browser/plugins/plugins_resource_service.h"
144 #endif 144 #endif
145 145
146 #if defined(ENABLE_WEBRTC) 146 #if defined(ENABLE_WEBRTC)
147 #include "chrome/browser/media/webrtc_log_uploader.h" 147 #include "chrome/browser/media/webrtc_log_uploader.h"
148 #endif 148 #endif
149 149
150 #if defined(OS_WIN) || defined(OS_CHROMEOS) 150 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_LINUX)
151 #include "chrome/browser/memory/oom_priority_manager.h" 151 #include "chrome/browser/memory/oom_priority_manager.h"
152 #endif 152 #endif
153 153
154 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 154 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
155 // How often to check if the persistent instance of Chrome needs to restart 155 // How often to check if the persistent instance of Chrome needs to restart
156 // to install an update. 156 // to install an update.
157 static const int kUpdateCheckIntervalHours = 6; 157 static const int kUpdateCheckIntervalHours = 6;
158 #endif 158 #endif
159 159
160 #if defined(USE_X11) || defined(OS_WIN) || defined(USE_OZONE) 160 #if defined(USE_X11) || defined(OS_WIN) || defined(USE_OZONE)
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 767
768 gcm::GCMDriver* BrowserProcessImpl::gcm_driver() { 768 gcm::GCMDriver* BrowserProcessImpl::gcm_driver() {
769 DCHECK(CalledOnValidThread()); 769 DCHECK(CalledOnValidThread());
770 if (!gcm_driver_) 770 if (!gcm_driver_)
771 CreateGCMDriver(); 771 CreateGCMDriver();
772 return gcm_driver_.get(); 772 return gcm_driver_.get();
773 } 773 }
774 774
775 memory::OomPriorityManager* BrowserProcessImpl::GetOomPriorityManager() { 775 memory::OomPriorityManager* BrowserProcessImpl::GetOomPriorityManager() {
776 DCHECK(CalledOnValidThread()); 776 DCHECK(CalledOnValidThread());
777 #if defined(OS_WIN) || defined(OS_CHROMEOS) 777 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_LINUX)
778 if (!oom_priority_manager_.get()) 778 if (!oom_priority_manager_.get())
779 oom_priority_manager_.reset(new memory::OomPriorityManager()); 779 oom_priority_manager_.reset(new memory::OomPriorityManager());
780 return oom_priority_manager_.get(); 780 return oom_priority_manager_.get();
781 #else 781 #else
782 return nullptr; 782 return nullptr;
783 #endif 783 #endif
784 } 784 }
785 785
786 ShellIntegration::DefaultWebClientState 786 ShellIntegration::DefaultWebClientState
787 BrowserProcessImpl::CachedDefaultWebClientState() { 787 BrowserProcessImpl::CachedDefaultWebClientState() {
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 } 1260 }
1261 1261
1262 void BrowserProcessImpl::OnAutoupdateTimer() { 1262 void BrowserProcessImpl::OnAutoupdateTimer() {
1263 if (CanAutorestartForUpdate()) { 1263 if (CanAutorestartForUpdate()) {
1264 DLOG(WARNING) << "Detected update. Restarting browser."; 1264 DLOG(WARNING) << "Detected update. Restarting browser.";
1265 RestartBackgroundInstance(); 1265 RestartBackgroundInstance();
1266 } 1266 }
1267 } 1267 }
1268 1268
1269 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1269 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.h ('k') | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698