backing out the kitchen sink.
authordwitte@stanford.edu
Mon, 19 Nov 2007 02:15:55 -0800
changeset 8166 bb146db9c2625785e71d2043ff74bdc617fc9bae
parent 8165 2a02747b82c5dc88b708b3ce38316a7468d3b0bf
child 8167 7a07dce62b7d64ee1a210e0f94617a0144337914
push idunknown
push userunknown
push dateunknown
milestone1.9b2pre
backing out the kitchen sink.
browser/app/profile/firefox.js
netwerk/cookie/src/nsCookieService.cpp
netwerk/test/TestCookie.cpp
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -335,17 +335,17 @@ pref("privacy.item.cache",      true);
 pref("privacy.item.siteprefs",  false);
 pref("privacy.item.sessions",   true);
 
 pref("privacy.sanitize.sanitizeOnShutdown", false);
 pref("privacy.sanitize.promptOnSanitize", true);
 
 pref("network.proxy.share_proxy_settings",  false); // use the same proxy settings for all protocols
 
-pref("network.cookie.cookieBehavior",       1); // 0-Accept, 1-dontAcceptForeign, 2-dontUse
+pref("network.cookie.cookieBehavior",       0); // cookies enabled
 pref("network.cookie.enableForCurrentSessionOnly", false);
 
 // l12n and i18n
 pref("intl.accept_languages", "chrome://global/locale/intl.properties");
 pref("intl.charsetmenu.browser.static", "chrome://global/locale/intl.properties");
 pref("intl.charsetmenu.browser.more1",  "chrome://global/locale/intl.properties");
 pref("intl.charsetmenu.browser.more2",  "chrome://global/locale/intl.properties");
 pref("intl.charsetmenu.browser.more3",  "chrome://global/locale/intl.properties");
--- a/netwerk/cookie/src/nsCookieService.cpp
+++ b/netwerk/cookie/src/nsCookieService.cpp
@@ -1783,21 +1783,19 @@ nsCookieService::IsForeign(nsIURI *aHost
   ToLowerCase(firstHost);
 
   // determine if it's foreign. we have a new algorithm for doing this,
   // since the old behavior was broken:
 
   // first ensure we're not dealing with IP addresses; if we are, require an
   // exact match. we can't avoid this, otherwise the algo below will allow two
   // IP's such as 128.12.96.5 and 213.12.96.5 to match.
-/*
   if (IsIPAddress(firstHost)) {
     return !IsInDomain(firstHost, currentHost, PR_FALSE);
   }
-*/
 
   // next, allow a one-subdomain-level "fuzz" in the comparison. first, we need
   // to find how many subdomain levels each host has; we only do the looser
   // comparison if they have the same number of levels. e.g.
   //  firstHost = weather.yahoo.com, currentHost = cookies.yahoo.com -> match
   //  firstHost =     a.b.yahoo.com, currentHost =       b.yahoo.com -> no match
   //  firstHost =         yahoo.com, currentHost = weather.yahoo.com -> no match
   //  (since the normal test (next) will catch this case and give a match.)
--- a/netwerk/test/TestCookie.cpp
+++ b/netwerk/test/TestCookie.cpp
@@ -506,17 +506,17 @@ main(PRInt32 argc, char *argv[])
       GetACookie(cookieService, "http://multiple.cookies/", nsnull, getter_Copies(cookie));
       rv[7] = CheckResult(cookie.get(), MUST_NOT_CONTAIN, "test=different");
       SetACookie(cookieService, "http://multiple.cookies/", nsnull,  "newtest=dead; max-age=0", nsnull);
       GetACookie(cookieService, "http://multiple.cookies/", nsnull, getter_Copies(cookie));
       rv[8] = CheckResult(cookie.get(), MUST_BE_NULL);
 
       allTestsPassed = PrintResult(rv, 9) && allTestsPassed;
 
-/*
+
       // *** foreign cookie tests
       printf("*** Beginning foreign cookie tests...\n");
 
       // test the blocking of foreign cookies, under various circumstances.
       // order of URI arguments is hostURI, firstURI
       SetACookie(cookieService, "http://yahoo.com/", "http://yahoo.com/", "test=foreign; domain=.yahoo.com", nsnull);
       GetACookie(cookieService, "http://yahoo.com/", "http://yahoo.com/", getter_Copies(cookie));
       rv[0] = CheckResult(cookie.get(), MUST_EQUAL, "test=foreign");
@@ -555,17 +555,17 @@ main(PRInt32 argc, char *argv[])
       SetACookie(cookieService, "http://192.168.54.33/", "http://192.168.54.33/", "test=foreign; domain=192.168.54.33; max-age=0", nsnull);
       GetACookie(cookieService, "http://192.168.54.33/", "http://192.168.54.33/", getter_Copies(cookie));
       rv[12] = CheckResult(cookie.get(), MUST_BE_NULL);
       SetACookie(cookieService, "http://192.168.54.33/", "http://148.168.54.33/", "test=foreign; domain=192.168.54.33", nsnull);
       GetACookie(cookieService, "http://192.168.54.33/", "http://192.168.54.33/", getter_Copies(cookie));
       rv[13] = CheckResult(cookie.get(), MUST_BE_NULL);
 
       allTestsPassed = PrintResult(rv, 14) && allTestsPassed;
-*/
+
 
       // *** parser tests
       printf("*** Beginning parser tests...\n");
 
       // test the cookie header parser, under various circumstances.
       SetACookie(cookieService, "http://parser.test/", nsnull, "test=parser; domain=.parser.test; ;; ;=; ,,, ===,abc,=; abracadabra! max-age=20;=;;", nsnull);
       GetACookie(cookieService, "http://parser.test/", nsnull, getter_Copies(cookie));
       rv[0] = CheckResult(cookie.get(), MUST_EQUAL, "test=parser");
@@ -593,17 +593,17 @@ main(PRInt32 argc, char *argv[])
       GetACookie(cookieService, "http://parser.test/", nsnull, getter_Copies(cookie));
       rv[7] = CheckResult(cookie.get(), MUST_EQUAL, "eight");
       SetACookie(cookieService, "http://parser.test/", nsnull, "test=six", nsnull);
       GetACookie(cookieService, "http://parser.test/", nsnull, getter_Copies(cookie));
       rv[9] = CheckResult(cookie.get(), MUST_CONTAIN, "test=six");
 
       allTestsPassed = PrintResult(rv, 10) && allTestsPassed;
 
-/*
+
       // *** mailnews tests
       printf("*** Beginning mailnews tests...\n");
 
       // test some mailnews cookies to ensure blockage.
       // we use null firstURI's deliberately, since we have hacks to deal with
       // this situation...
       SetACookie(cookieService, "mailbox://mail.co.uk/", nsnull, "test=mailnews", nsnull);
       GetACookie(cookieService, "mailbox://mail.co.uk/", nsnull, getter_Copies(cookie));
@@ -623,17 +623,17 @@ main(PRInt32 argc, char *argv[])
       SetACookie(cookieService, "mailbox://mail.co.uk/", "http://mail.co.uk/", "test=mailnews", nsnull);
       GetACookie(cookieService, "http://mail.co.uk/", nsnull, getter_Copies(cookie));
       rv[5] = CheckResult(cookie.get(), MUST_BE_NULL);
       SetACookie(cookieService, "http://mail.co.uk/", "mailbox://mail.co.uk/", "test=mailnews", nsnull);
       GetACookie(cookieService, "http://mail.co.uk/", nsnull, getter_Copies(cookie));
       rv[6] = CheckResult(cookie.get(), MUST_BE_NULL);
 
       allTestsPassed = PrintResult(rv, 7) && allTestsPassed;
-*/
+
 
       // *** path ordering tests
       printf("*** Beginning path ordering tests...\n");
 
       // test that cookies are returned in path order - longest to shortest.
       // if the header doesn't specify a path, it's taken from the host URI.
       SetACookie(cookieService, "http://multi.path.tests/", nsnull, "test1=path; path=/one/two/three", nsnull);
       SetACookie(cookieService, "http://multi.path.tests/", nsnull, "test2=path; path=/one \n test3=path; path=/one/two/three/four \n test4=path; path=/one/two \n test5=path; path=/one/two/", nsnull);