Bug 1421324 - Modify rejection timing when processing httponly cookie on CookieServiceChild. r=jdm

This commit is contained in:
Amy Chung 2017-12-14 13:29:32 -06:00
Родитель 5b721eca4c
Коммит 222e1893c3
3 изменённых файлов: 7 добавлений и 8 удалений

Просмотреть файл

@ -181,7 +181,7 @@ CookieServiceChild::RecvAddCookie(const CookieStruct &aCookie,
aCookie.creationTime(),
aCookie.isSession(),
aCookie.isSecure(),
false,
aCookie.isHttpOnly(),
aAttrs,
aCookie.sameSite());
RecordDocumentCookie(cookie, aAttrs);
@ -362,9 +362,6 @@ CookieServiceChild::SetCookieInternal(nsCookieAttributes &aCookieAt
bool aFromHttp,
nsICookiePermission *aPermissionService)
{
if (aCookieAttributes.isHttpOnly) {
return;
}
int64_t currentTimeInUsec = PR_Now();
RefPtr<nsCookie> cookie =
nsCookie::Create(aCookieAttributes.name,
@ -430,7 +427,9 @@ CookieServiceChild::RecordDocumentCookie(nsCookie *aCookie,
return;
}
cookiesList->AppendElement(aCookie);
if (!aCookie->IsHttpOnly()) {
cookiesList->AppendElement(aCookie);
}
}
nsresult

Просмотреть файл

@ -91,6 +91,7 @@ GetInfoFromCookie(nsCookie *aCookie,
aCookieStruct.creationTime() = aCookie->CreationTime();
aCookieStruct.isSession() = aCookie->IsSession();
aCookieStruct.isSecure() = aCookie->IsSecure();
aCookieStruct.isHttpOnly() = aCookie->IsHttpOnly();
aCookieStruct.sameSite() = aCookie->SameSite();
}
@ -140,9 +141,7 @@ CookieServiceParent::AddCookie(nsICookie *aCookie)
OriginAttributes attrs = cookie->OriginAttributesRef();
CookieStruct cookieStruct;
GetInfoFromCookie(cookie, cookieStruct);
if (!cookie->IsHttpOnly()) {
Unused << SendAddCookie(cookieStruct, attrs);
}
Unused << SendAddCookie(cookieStruct, attrs);
}
void

Просмотреть файл

@ -221,6 +221,7 @@ struct CookieStruct
int64_t expiry;
int64_t lastAccessed;
int64_t creationTime;
bool isHttpOnly;
bool isSession;
bool isSecure;
int8_t sameSite;