Bug 1368962 P1 Expose LoadInfo::SynthesizeServiceWorkerTainting(). r=ckerschb

This commit is contained in:
Ben Kelly 2017-06-07 08:14:57 -07:00
Родитель db983a3ae9
Коммит c405b96cf8
2 изменённых файлов: 15 добавлений и 0 удалений

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

@ -952,6 +952,13 @@ LoadInfo::MaybeIncreaseTainting(uint32_t aTainting)
return NS_OK;
}
void
LoadInfo::SynthesizeServiceWorkerTainting(LoadTainting aTainting)
{
MOZ_DIAGNOSTIC_ASSERT(aTainting <= LoadTainting::Opaque);
mTainting = aTainting;
}
NS_IMETHODIMP
LoadInfo::GetIsTopLevelLoad(bool *aResult)
{

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

@ -74,6 +74,14 @@ public:
// when a separate request is made with the same security properties.
already_AddRefed<nsILoadInfo> CloneForNewRequest() const;
// The service worker and fetch specifications require returning the
// exact tainting level of the Response passed to FetchEvent.respondWith().
// This method allows us to override the tainting level in that case.
//
// NOTE: This should not be used outside of service worker code! Use
// nsILoadInfo::MaybeIncreaseTainting() instead.
void SynthesizeServiceWorkerTainting(LoadTainting aTainting);
void SetIsPreflight();
void SetUpgradeInsecureRequests();