summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorslightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-01 23:33:56 +0000
committerslightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-01 23:33:56 +0000
commit4c630bb277d36826cd4c654ab93b8a44dfd88842 (patch)
tree43cdfdd2bb203178694f5ded5865f6ac20243ac9 /chrome/browser/renderer_host
parent0426867d2404934ec24505ea674174e36bd320d8 (diff)
downloadchromium_src-4c630bb277d36826cd4c654ab93b8a44dfd88842.zip
chromium_src-4c630bb277d36826cd4c654ab93b8a44dfd88842.tar.gz
chromium_src-4c630bb277d36826cd4c654ab93b8a44dfd88842.tar.bz2
Adds a command line flag to suppress flashing blinking for those who really, REALLY want it to stop.
BUG=None TEST=load tons of tabs after starting with --disable-backing-store-limit and observe no blinking and HUGE memory usage. Review URL: http://codereview.chromium.org/660224 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40317 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/backing_store_manager.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/backing_store_manager.cc b/chrome/browser/renderer_host/backing_store_manager.cc
index 39149f2..4325f31 100644
--- a/chrome/browser/renderer_host/backing_store_manager.cc
+++ b/chrome/browser/renderer_host/backing_store_manager.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/renderer_host/backing_store_manager.h"
#include "base/sys_info.h"
+#include "base/command_line.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/browser/renderer_host/backing_store.h"
#include "chrome/browser/renderer_host/render_widget_host.h"
#include "chrome/browser/renderer_host/render_widget_host_painting_observer.h"
@@ -40,9 +42,22 @@ const size_t kMemoryMultiplier = 4 * 1920 * 1200; // ~9MB
// Use a minimum of 2, and add one for each 256MB of physical memory you have.
// Cap at 5, the thinking being that even if you have a gigantic amount of
// RAM, there's a limit to how much caching helps beyond a certain number
-// of tabs.
+// of tabs. If users *really* want unlimited stores, allow it via the
+// --disable-backing-store-limit flag.
static size_t MaxNumberOfBackingStores() {
- return std::min(5, 2 + (base::SysInfo::AmountOfPhysicalMemoryMB() / 256));
+ static bool unlimited = false;
+ const CommandLine& command = *CommandLine::ForCurrentProcess();
+ unlimited = command.HasSwitch(switches::kDisableBackingStoreLimit);
+
+
+ if (unlimited) {
+ // 100 isn't truly unlimited, but given that backing stores count against
+ // GDI memory, it's well past any reasonable number. Many systems will
+ // begin to fail in strange ways well before they hit 100 stores.
+ return 100;
+ } else {
+ return std::min(5, 2 + (base::SysInfo::AmountOfPhysicalMemoryMB() / 256));
+ }
}
// The maximum about of memory to use for all BackingStoreCache object combined.