Bug 590611 - Raise cookies per basedomain limit to 150. r=sdwilsh, a=clegnitto
authorDan Witte <dwitte@mozilla.com>
Fri, 24 Sep 2010 16:12:21 -0700
changeset 34604 d49e8022e89285c02eb13ebef7b17b8a90472b87
parent 34603 06dbab839a941b9de0dbbf353d1706319b26b72c
child 34605 7e02b0747e538c530d5d5bc2ecfae97c29d3a536
push id1581
push userdwitte@mozilla.com
push dateFri, 24 Sep 2010 23:44:19 +0000
reviewerssdwilsh, clegnitto
bugs590611
milestone1.9.2.11pre
Bug 590611 - Raise cookies per basedomain limit to 150. r=sdwilsh, a=clegnitto
netwerk/cookie/src/nsCookieService.cpp
netwerk/test/TestCookie.cpp
--- a/netwerk/cookie/src/nsCookieService.cpp
+++ b/netwerk/cookie/src/nsCookieService.cpp
@@ -89,17 +89,17 @@ static const PRInt64 kCookieStaleThresho
 static const char kOldCookieFileName[] = "cookies.txt";
 
 #undef  LIMIT
 #define LIMIT(x, low, high, default) ((x) >= (low) && (x) <= (high) ? (x) : (default))
 
 // 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;
 
 // these constants represent a decision about a cookie based on user prefs.
 static const PRUint32 STATUS_ACCEPTED            = 0;
 static const PRUint32 STATUS_REJECTED            = 1;
 // STATUS_REJECTED_WITH_ERROR indicates the cookie should be rejected because
 // of an error (rather than something the user can control). this is used for
--- a/netwerk/test/TestCookie.cpp
+++ b/netwerk/test/TestCookie.cpp
@@ -56,16 +56,17 @@ static NS_DEFINE_CID(kPrefServiceCID,   
 
 // various pref strings
 static const char kCookiesPermissions[] = "network.cookie.cookieBehavior";
 static const char kCookiesLifetimeEnabled[] = "network.cookie.lifetime.enabled";
 static const char kCookiesLifetimeDays[] = "network.cookie.lifetime.days";
 static const char kCookiesLifetimeCurrentSession[] = "network.cookie.lifetime.behavior";
 static const char kCookiesP3PString[] = "network.cookie.p3p";
 static const char kCookiesAskPermission[] = "network.cookie.warnAboutCookies";
+static const char kCookiesMaxPerHost[] = "network.cookie.maxPerHost";
 
 nsresult
 SetACookie(nsICookieService *aCookieService, const char *aSpec1, const char *aSpec2, const char* aCookieString, const char *aServerTime)
 {
     nsCOMPtr<nsIURI> uri1, uri2;
     NS_NewURI(getter_AddRefs(uri1), aSpec1);
     if (aSpec2)
         NS_NewURI(getter_AddRefs(uri2), aSpec2);
@@ -204,16 +205,18 @@ InitPrefs(nsIPrefBranch *aPrefBranch)
     // init some relevant prefs, so the tests don't go awry.
     // we use the most restrictive set of prefs we can;
     // however, we don't test third party blocking here.
     aPrefBranch->SetIntPref(kCookiesPermissions, 0); // accept all
     aPrefBranch->SetBoolPref(kCookiesLifetimeEnabled, PR_TRUE);
     aPrefBranch->SetIntPref(kCookiesLifetimeCurrentSession, 0);
     aPrefBranch->SetIntPref(kCookiesLifetimeDays, 1);
     aPrefBranch->SetBoolPref(kCookiesAskPermission, PR_FALSE);
+    // Set the base domain limit to 50 so we have a known value.
+    aPrefBranch->SetIntPref(kCookiesMaxPerHost, 50);
 }
 
 class ScopedXPCOM
 {
 public:
   ScopedXPCOM() : rv(NS_InitXPCOM2(nsnull, nsnull, nsnull)) { }
   ~ScopedXPCOM()
   {