Bug 1339129 - Remove access to HTTP-only cookies from the child process; r=jdm

This commit is contained in:
Ehsan Akhgari 2017-02-13 13:04:21 -05:00
Родитель 42d8ee76ab
Коммит cbdcae43c2
5 изменённых файлов: 12 добавлений и 24 удалений

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

@ -101,8 +101,7 @@ CookieServiceChild::RequireThirdPartyCheck()
nsresult
CookieServiceChild::GetCookieStringInternal(nsIURI *aHostURI,
nsIChannel *aChannel,
char **aCookieString,
bool aFromHttp)
char **aCookieString)
{
NS_ENSURE_ARG(aHostURI);
NS_ENSURE_ARG_POINTER(aCookieString);
@ -134,7 +133,7 @@ CookieServiceChild::GetCookieStringInternal(nsIURI *aHostURI,
// Synchronously call the parent.
nsAutoCString result;
SendGetCookieString(uriParams, !!isForeign, aFromHttp, attrs, &result);
SendGetCookieString(uriParams, !!isForeign, attrs, &result);
if (!result.IsEmpty())
*aCookieString = ToNewCString(result);
@ -145,8 +144,7 @@ nsresult
CookieServiceChild::SetCookieStringInternal(nsIURI *aHostURI,
nsIChannel *aChannel,
const char *aCookieString,
const char *aServerTime,
bool aFromHttp)
const char *aServerTime)
{
NS_ENSURE_ARG(aHostURI);
NS_ENSURE_ARG_POINTER(aCookieString);
@ -181,7 +179,7 @@ CookieServiceChild::SetCookieStringInternal(nsIURI *aHostURI,
// Synchronously call the parent.
SendSetCookieString(uriParams, !!isForeign, cookieString, serverTime,
aFromHttp, attrs);
attrs);
return NS_OK;
}
@ -204,7 +202,7 @@ CookieServiceChild::GetCookieString(nsIURI *aHostURI,
nsIChannel *aChannel,
char **aCookieString)
{
return GetCookieStringInternal(aHostURI, aChannel, aCookieString, false);
return GetCookieStringInternal(aHostURI, aChannel, aCookieString);
}
NS_IMETHODIMP
@ -213,7 +211,7 @@ CookieServiceChild::GetCookieStringFromHttp(nsIURI *aHostURI,
nsIChannel *aChannel,
char **aCookieString)
{
return GetCookieStringInternal(aHostURI, aChannel, aCookieString, true);
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
@ -222,8 +220,7 @@ CookieServiceChild::SetCookieString(nsIURI *aHostURI,
const char *aCookieString,
nsIChannel *aChannel)
{
return SetCookieStringInternal(aHostURI, aChannel, aCookieString,
nullptr, false);
return SetCookieStringInternal(aHostURI, aChannel, aCookieString, nullptr);
}
NS_IMETHODIMP
@ -234,8 +231,7 @@ CookieServiceChild::SetCookieStringFromHttp(nsIURI *aHostURI,
const char *aServerTime,
nsIChannel *aChannel)
{
return SetCookieStringInternal(aHostURI, aChannel, aCookieString,
aServerTime, true);
return NS_ERROR_NOT_IMPLEMENTED;
}
} // namespace net

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

@ -42,14 +42,12 @@ protected:
nsresult GetCookieStringInternal(nsIURI *aHostURI,
nsIChannel *aChannel,
char **aCookieString,
bool aFromHttp);
char **aCookieString);
nsresult SetCookieStringInternal(nsIURI *aHostURI,
nsIChannel *aChannel,
const char *aCookieString,
const char *aServerTime,
bool aFromHttp);
const char *aServerTime);
void PrefChanged(nsIPrefBranch *aPrefBranch);

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

@ -92,7 +92,6 @@ CookieServiceParent::ActorDestroy(ActorDestroyReason aWhy)
mozilla::ipc::IPCResult
CookieServiceParent::RecvGetCookieString(const URIParams& aHost,
const bool& aIsForeign,
const bool& aFromHttp,
const OriginAttributes& aAttrs,
nsCString* aResult)
{
@ -106,7 +105,7 @@ CookieServiceParent::RecvGetCookieString(const URIParams& aHost,
return IPC_FAIL_NO_REASON(this);
bool isPrivate = aAttrs.mPrivateBrowsingId > 0;
mCookieService->GetCookieStringInternal(hostURI, aIsForeign, aFromHttp, aAttrs,
mCookieService->GetCookieStringInternal(hostURI, aIsForeign, false, aAttrs,
isPrivate, *aResult);
return IPC_OK();
}
@ -116,7 +115,6 @@ CookieServiceParent::RecvSetCookieString(const URIParams& aHost,
const bool& aIsForeign,
const nsCString& aCookieString,
const nsCString& aServerTime,
const bool& aFromHttp,
const OriginAttributes& aAttrs)
{
if (!mCookieService)
@ -144,7 +142,7 @@ CookieServiceParent::RecvSetCookieString(const URIParams& aHost,
// NB: dummyChannel could be null if something failed in CreateDummyChannel.
nsDependentCString cookieString(aCookieString, 0);
mCookieService->SetCookieStringInternal(hostURI, aIsForeign, cookieString,
aServerTime, aFromHttp, aAttrs,
aServerTime, false, aAttrs,
isPrivate, dummyChannel);
return IPC_OK();
}

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

@ -25,7 +25,6 @@ protected:
virtual mozilla::ipc::IPCResult RecvGetCookieString(const URIParams& aHost,
const bool& aIsForeign,
const bool& aFromHttp,
const OriginAttributes& aAttrs,
nsCString* aResult) override;
@ -33,7 +32,6 @@ protected:
const bool& aIsForeign,
const nsCString& aCookieString,
const nsCString& aServerTime,
const bool& aFromHttp,
const OriginAttributes& aAttrs) override;
RefPtr<nsCookieService> mCookieService;

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

@ -61,7 +61,6 @@ parent:
*/
nested(inside_cpow) sync GetCookieString(URIParams host,
bool isForeign,
bool fromHttp,
OriginAttributes attrs)
returns (nsCString result);
@ -98,7 +97,6 @@ parent:
bool isForeign,
nsCString cookieString,
nsCString serverTime,
bool fromHttp,
OriginAttributes attrs);
async __delete__();