summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 23:06:31 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 23:06:31 +0000
commite5642991cb7d0c2efde4c9d6569b723f7fdc8837 (patch)
tree9cf8c2f2ce5bdd43958b40200c4c615c2afefd79 /net
parent6678c41a2622e607ab41ff67cee7761ade2f5468 (diff)
downloadchromium_src-e5642991cb7d0c2efde4c9d6569b723f7fdc8837.zip
chromium_src-e5642991cb7d0c2efde4c9d6569b723f7fdc8837.tar.gz
chromium_src-e5642991cb7d0c2efde4c9d6569b723f7fdc8837.tar.bz2
Add a command line switch to allow setting the max size
of the disk cache. This switch is intended for troubleshooting, not to add another supported configuration. BUG=15117 TEST=none Review URL: http://codereview.chromium.org/146136 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19439 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/disk_cache/backend_impl.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index d17b5e3..d41efe8 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -582,6 +582,10 @@ bool BackendImpl::SetMaxSize(int max_bytes) {
if (!max_bytes)
return true;
+ // Avoid a DCHECK later on.
+ if (max_bytes >= kint32max - kint32max / 10)
+ max_bytes = kint32max - kint32max / 10 - 1;
+
user_flags_ |= kMaxSize;
max_size_ = max_bytes;
return true;