Bug 590611 - Raise cookies per basedomain limit to 150. r=sdwilsh, a=betaN+
authorDan Witte <dwitte@mozilla.com>
Wed, 01 Sep 2010 16:27:10 -0700
changeset 52139 a02aee4f7197c336b1307f909fb1c950265cbbd3
parent 52138 8a1dd2ad86b51c44d9b1c27bbe3772a45973d0a0
child 52140 b290cb3e624c7ca2db053740e4cd349b54652159
push idunknown
push userunknown
push dateunknown
reviewerssdwilsh, betaN
bugs590611
milestone2.0b5pre
Bug 590611 - Raise cookies per basedomain limit to 150. r=sdwilsh, a=betaN+
extensions/cookie/test/unit/test_domain_eviction.js
netwerk/cookie/nsCookieService.cpp
--- a/extensions/cookie/test/unit/test_domain_eviction.js
+++ b/extensions/cookie/test/unit/test_domain_eviction.js
@@ -1,14 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 function run_test()
 {
+  // Set the base domain limit to 50 so we have a known value.
+  Services.prefs.setIntPref("network.cookie.maxPerHost", 50);
+
   var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
 
   cm.removeAll();
 
   // test eviction under the 50 cookies per base domain limit. this means
   // that cookies for foo.com and bar.foo.com should count toward this limit,
   // while cookies for baz.com should not. there are several tests we perform
   // to make sure the base domain logic is working correctly.
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -111,17 +111,17 @@ static const char kOldCookieFileName[] =
 #define LIMIT(x, low, high, default) ((x) >= (low) && (x) <= (high) ? (x) : (default))
 
 #undef  ADD_TEN_PERCENT
 #define ADD_TEN_PERCENT(i) ((i) + (i)/10)
 
 // default limits for the cookie list. these can be tuned by the
 // network.cookie.maxNumber and network.cookie.maxPerHost prefs respectively.
 static const PRUint32 kMaxNumberOfCookies = 3000;
-static const PRUint32 kMaxCookiesPerHost  = 50;
+static const PRUint32 kMaxCookiesPerHost  = 150;
 static const PRUint32 kMaxBytesPerCookie  = 4096;
 static const PRUint32 kMaxBytesPerPath    = 1024;
 
 // behavior pref constants
 static const PRUint32 BEHAVIOR_ACCEPT        = 0;
 static const PRUint32 BEHAVIOR_REJECTFOREIGN = 1;
 static const PRUint32 BEHAVIOR_REJECT        = 2;