From 1990919b33fbe64c6b45d35a1c6549435ada7587 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Fri, 19 Feb 2016 15:55:23 +0100 Subject: [PATCH] Backed out changeset 27f3968ae8b2 (bug 1245184) --- browser/base/content/sanitize.js | 3 +-- browser/components/preferences/cookies.js | 17 +++++------------ dom/base/ChromeUtils.cpp | 11 ----------- dom/base/ChromeUtils.h | 5 ----- dom/webidl/ChromeUtils.webidl | 7 ------- netwerk/cookie/nsCookieService.cpp | 8 +------- netwerk/cookie/nsICookieManager.idl | 11 ++++------- netwerk/test/TestCookie.cpp | 4 +--- netwerk/test/moz.build | 2 -- 9 files changed, 12 insertions(+), 56 deletions(-) diff --git a/browser/base/content/sanitize.js b/browser/base/content/sanitize.js index 507e7579758..2639489cd92 100644 --- a/browser/base/content/sanitize.js +++ b/browser/base/content/sanitize.js @@ -241,8 +241,7 @@ Sanitizer.prototype = { if (cookie.creationTime > range[0]) { // This cookie was created after our cutoff, clear it - cookieMgr.remove(cookie.host, cookie.name, cookie.path, - cookie.originAttributes, false); + cookieMgr.remove(cookie.host, cookie.name, cookie.path, false); if (++yieldCounter % YIELD_PERIOD == 0) { yield new Promise(resolve => setTimeout(resolve, 0)); // Don't block the main thread too long diff --git a/browser/components/preferences/cookies.js b/browser/components/preferences/cookies.js index 827a059707f..a757c02db25 100644 --- a/browser/components/preferences/cookies.js +++ b/browser/components/preferences/cookies.js @@ -71,9 +71,7 @@ var gCookiesWindow = { _cookieEquals: function (aCookieA, aCookieB, aStrippedHost) { return aCookieA.rawHost == aStrippedHost && aCookieA.name == aCookieB.name && - aCookieA.path == aCookieB.path && - ChromeUtils.isOriginAttributesEqual(aCookieA.originAttributes, - aCookieB.originAttributes); + aCookieA.path == aCookieB.path; }, observe: function (aCookie, aTopic, aData) { @@ -278,19 +276,15 @@ var gCookiesWindow = { var item = this._getItemAtIndex(aIndex); if (!item) return; this._invalidateCache(aIndex - 1); - if (item.container) { + if (item.container) gCookiesWindow._hosts[item.rawHost] = null; - } else { + else { var parent = this._getItemAtIndex(item.parentIndex); for (var i = 0; i < parent.cookies.length; ++i) { var cookie = parent.cookies[i]; if (item.rawHost == cookie.rawHost && - item.name == cookie.name && - item.path == cookie.path && - ChromeUtils.isOriginAttributesEqual(item.originAttributes, - cookie.originAttributes)) { + item.name == cookie.name && item.path == cookie.path) parent.cookies.splice(i, removeCount); - } } } }, @@ -590,8 +584,7 @@ var gCookiesWindow = { blockFutureCookies = psvc.getBoolPref("network.cookie.blockFutureCookies"); for (var i = 0; i < deleteItems.length; ++i) { var item = deleteItems[i]; - this._cm.remove(item.host, item.name, item.path, - item.originAttributes, blockFutureCookies); + this._cm.remove(item.host, item.name, item.path, blockFutureCookies); } }, diff --git a/dom/base/ChromeUtils.cpp b/dom/base/ChromeUtils.cpp index b555ccb7401..4d9336d62c9 100644 --- a/dom/base/ChromeUtils.cpp +++ b/dom/base/ChromeUtils.cpp @@ -100,17 +100,6 @@ ChromeUtils::CreateOriginAttributesFromDict(dom::GlobalObject& aGlobal, aNewAttrs = aAttrs; } -/* static */ bool -ChromeUtils::IsOriginAttributesEqual(dom::GlobalObject& aGlobal, - const dom::OriginAttributesDictionary& aA, - const dom::OriginAttributesDictionary& aB) -{ - return aA.mAddonId == aB.mAddonId && - aA.mAppId == aB.mAppId && - aA.mInBrowser == aB.mInBrowser && - aA.mSignedPkg == aB.mSignedPkg && - aA.mUserContextId == aB.mUserContextId; -} } // namespace dom } // namespace mozilla diff --git a/dom/base/ChromeUtils.h b/dom/base/ChromeUtils.h index fee69a02fea..8e16e000d75 100644 --- a/dom/base/ChromeUtils.h +++ b/dom/base/ChromeUtils.h @@ -72,11 +72,6 @@ public: CreateOriginAttributesFromDict(dom::GlobalObject& aGlobal, const dom::OriginAttributesDictionary& aAttrs, dom::OriginAttributesDictionary& aNewAttrs); - - static bool - IsOriginAttributesEqual(dom::GlobalObject& aGlobal, - const dom::OriginAttributesDictionary& aA, - const dom::OriginAttributesDictionary& aB); }; } // namespace dom diff --git a/dom/webidl/ChromeUtils.webidl b/dom/webidl/ChromeUtils.webidl index 8d91feff732..c15efad01d9 100644 --- a/dom/webidl/ChromeUtils.webidl +++ b/dom/webidl/ChromeUtils.webidl @@ -63,13 +63,6 @@ interface ChromeUtils : ThreadSafeChromeUtils { */ static OriginAttributesDictionary createOriginAttributesFromDict(optional OriginAttributesDictionary originAttrs); - - /** - * Returns true if the 2 OriginAttributes are equal. - */ - static boolean - isOriginAttributesEqual(optional OriginAttributesDictionary aA, - optional OriginAttributesDictionary aB); }; /** diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index 8c328722939..24464593b44 100644 --- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -2366,15 +2366,9 @@ NS_IMETHODIMP nsCookieService::Remove(const nsACString &aHost, const nsACString &aName, const nsACString &aPath, - JS::HandleValue aOriginAttributes, - bool aBlocked, - JSContext* aCx) + bool aBlocked) { NeckoOriginAttributes attrs; - if (!attrs.Init(aCx, aOriginAttributes)) { - return NS_ERROR_FAILURE; - } - return Remove(aHost, attrs, aName, aPath, aBlocked); } diff --git a/netwerk/cookie/nsICookieManager.idl b/netwerk/cookie/nsICookieManager.idl index 6667c5a88f2..bccef1e46a7 100644 --- a/netwerk/cookie/nsICookieManager.idl +++ b/netwerk/cookie/nsICookieManager.idl @@ -39,14 +39,11 @@ interface nsICookieManager : nsISupports * dot must be present. * @param aName The name specified in the cookie * @param aPath The path for which the cookie was set - * @param aOriginAttributes The originAttributes of this cookie * @param aBlocked Indicates if cookies from this host should be permanently blocked * */ - [implicit_jscontext] - void remove(in AUTF8String aHost, - in ACString aName, - in AUTF8String aPath, - in jsval aOriginAttributes, - in boolean aBlocked); + void remove(in AUTF8String aHost, + in ACString aName, + in AUTF8String aPath, + in boolean aBlocked); }; diff --git a/netwerk/test/TestCookie.cpp b/netwerk/test/TestCookie.cpp index c5b1d414d23..e123ec66b25 100644 --- a/netwerk/test/TestCookie.cpp +++ b/netwerk/test/TestCookie.cpp @@ -675,9 +675,7 @@ main(int32_t argc, char *argv[]) rv[10] = NS_SUCCEEDED(cookieMgr->Remove(NS_LITERAL_CSTRING("new.domain"), // domain NS_LITERAL_CSTRING("test3"), // name NS_LITERAL_CSTRING("/rabbit"), // path - JS::NullHandleValue, // originAttributes - true, // is blocked - nullptr)); // JSContext + true)); // is blocked rv[11] = NS_SUCCEEDED(cookieMgr2->CookieExists(newDomainCookie, &found)) && !found; rv[12] = NS_SUCCEEDED(cookieMgr2->Add(NS_LITERAL_CSTRING("new.domain"), // domain NS_LITERAL_CSTRING("/rabbit"), // path diff --git a/netwerk/test/moz.build b/netwerk/test/moz.build index 7e84dada903..238f7c1569d 100644 --- a/netwerk/test/moz.build +++ b/netwerk/test/moz.build @@ -52,6 +52,4 @@ RESOURCE_FILES += [ 'urlparse_unx.dat', ] -USE_LIBS += ['static:js'] - CXXFLAGS += CONFIG['TK_CFLAGS']