|
|
|
Lines 1803-1818
HttpChannelChild::Redirect1Begin(const u
|
Link Here
|
|---|
|
| 1803 |
|
1803 |
|
| 1804 |
void |
1804 |
void |
| 1805 |
HttpChannelChild::BeginNonIPCRedirect(nsIURI* responseURI, |
1805 |
HttpChannelChild::BeginNonIPCRedirect(nsIURI* responseURI, |
| 1806 |
const nsHttpResponseHead* responseHead, |
1806 |
const nsHttpResponseHead* responseHead, |
| 1807 |
bool aResponseRedirected) |
1807 |
bool aResponseRedirected) |
| 1808 |
{ |
1808 |
{ |
| 1809 |
LOG(("HttpChannelChild::BeginNonIPCRedirect [this=%p]\n", this)); |
1809 |
LOG(("HttpChannelChild::BeginNonIPCRedirect [this=%p]\n", this)); |
| 1810 |
|
1810 |
|
|
|
1811 |
// This method is only used by child-side service workers. It should not be |
| 1812 |
// used by new code. We want to remove it in the future. |
| 1813 |
MOZ_DIAGNOSTIC_ASSERT(mSynthesizedResponse); |
| 1814 |
|
| 1811 |
// If the response has been redirected, propagate all the URLs to content. |
1815 |
// If the response has been redirected, propagate all the URLs to content. |
| 1812 |
// Thus, the exact value of the redirect flag does not matter as long as it's |
1816 |
// Thus, the exact value of the redirect flag does not matter as long as it's |
| 1813 |
// not REDIRECT_INTERNAL. |
1817 |
// not REDIRECT_INTERNAL. |
| 1814 |
const uint32_t redirectFlag = |
1818 |
const uint32_t redirectFlag = |
| 1815 |
aResponseRedirected ? nsIChannelEventSink::REDIRECT_TEMPORARY |
1819 |
aResponseRedirected ? nsIChannelEventSink::REDIRECT_TEMPORARY |
| 1816 |
: nsIChannelEventSink::REDIRECT_INTERNAL; |
1820 |
: nsIChannelEventSink::REDIRECT_INTERNAL; |
| 1817 |
|
1821 |
|
| 1818 |
|
1822 |
|
|
Lines 1828-1843
HttpChannelChild::BeginNonIPCRedirect(ns
|
Link Here
|
|---|
|
| 1828 |
// is a synthesized response that has its own security info, the pre-redirect channel |
1832 |
// is a synthesized response that has its own security info, the pre-redirect channel |
| 1829 |
// has already received it and it must be propagated to the post-redirect channel. |
1833 |
// has already received it and it must be propagated to the post-redirect channel. |
| 1830 |
nsCOMPtr<nsIHttpChannelChild> channelChild = do_QueryInterface(newChannel); |
1834 |
nsCOMPtr<nsIHttpChannelChild> channelChild = do_QueryInterface(newChannel); |
| 1831 |
if (mSecurityInfo && channelChild) { |
1835 |
if (mSecurityInfo && channelChild) { |
| 1832 |
HttpChannelChild* httpChannelChild = static_cast<HttpChannelChild*>(channelChild.get()); |
1836 |
HttpChannelChild* httpChannelChild = static_cast<HttpChannelChild*>(channelChild.get()); |
| 1833 |
httpChannelChild->OverrideSecurityInfoForNonIPCRedirect(mSecurityInfo); |
1837 |
httpChannelChild->OverrideSecurityInfoForNonIPCRedirect(mSecurityInfo); |
| 1834 |
} |
1838 |
} |
| 1835 |
|
1839 |
|
|
|
1840 |
// Normally we don't propagate the LoadInfo's service worker tainting |
| 1841 |
// synthesis flag on redirect. A real redirect normally will want to allow |
| 1842 |
// normal tainting to proceed from its starting taint. For this particular |
| 1843 |
// redirect, though, we are performing a redirect to communicate the URL of |
| 1844 |
// the service worker synthetic response itself. This redirect still represents |
| 1845 |
// the synthetic response, so we must preserve the flag. |
| 1846 |
if (mLoadInfo && mLoadInfo->GetServiceWorkerTaintingSynthesized()) { |
| 1847 |
nsCOMPtr<nsILoadInfo> newChannelLoadInfo; |
| 1848 |
Unused << newChannel->GetLoadInfo(getter_AddRefs(newChannelLoadInfo)); |
| 1849 |
if (newChannelLoadInfo) { |
| 1850 |
newChannelLoadInfo->SynthesizeServiceWorkerTainting(mLoadInfo->GetTainting()); |
| 1851 |
} |
| 1852 |
} |
| 1853 |
|
| 1836 |
nsCOMPtr<nsIEventTarget> target = GetNeckoTarget(); |
1854 |
nsCOMPtr<nsIEventTarget> target = GetNeckoTarget(); |
| 1837 |
MOZ_ASSERT(target); |
1855 |
MOZ_ASSERT(target); |
| 1838 |
|
1856 |
|
| 1839 |
rv = gHttpHandler->AsyncOnChannelRedirect(this, |
1857 |
rv = gHttpHandler->AsyncOnChannelRedirect(this, |
| 1840 |
newChannel, |
1858 |
newChannel, |
| 1841 |
redirectFlag, |
1859 |
redirectFlag, |
| 1842 |
target); |
1860 |
target); |
| 1843 |
} |
1861 |
} |