Backed out changeset 27f3968ae8b2 (bug 1245184)

This commit is contained in:
Carsten "Tomcat" Book 2016-02-19 15:55:23 +01:00
parent 5e75403abe
commit 1990919b33
9 changed files with 12 additions and 56 deletions

View File

@ -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

View File

@ -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,21 +276,17 @@ 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);
}
}
}
},
_invalidateCache: function (aIndex) {
@ -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);
}
},

View File

@ -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

View File

@ -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

View File

@ -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);
};
/**

View File

@ -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);
}

View File

@ -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);
};

View File

@ -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

View File

@ -52,6 +52,4 @@ RESOURCE_FILES += [
'urlparse_unx.dat',
]
USE_LIBS += ['static:js']
CXXFLAGS += CONFIG['TK_CFLAGS']