Bug 1575090 - expose a response's COEP on nsIHttpChannelInternal r=JuniorHsu,necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D46176
This commit is contained in:
Eden Chuang 2020-04-20 17:25:59 +00:00
Родитель 402bac7f4d
Коммит 492deaebd5
4 изменённых файлов: 13 добавлений и 6 удалений

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

@ -735,5 +735,10 @@ NS_IMETHODIMP ClassifierDummyChannel::IsThirdPartySocialTrackingResource(
void ClassifierDummyChannel::DoDiagnosticAssertWhenOnStopNotCalledOnDestroy() {}
NS_IMETHODIMP ClassifierDummyChannel::GetResponseEmbedderPolicy(
nsILoadInfo::CrossOriginEmbedderPolicy* aOutPolicy) {
return NS_ERROR_NOT_IMPLEMENTED;
}
} // namespace net
} // namespace mozilla

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

@ -4411,8 +4411,8 @@ void HttpBaseChannel::SetIPv4Disabled() { mCaps |= NS_HTTP_DISABLE_IPV4; }
void HttpBaseChannel::SetIPv6Disabled() { mCaps |= NS_HTTP_DISABLE_IPV6; }
nsresult HttpBaseChannel::GetResponseEmbedderPolicy(
nsILoadInfo::CrossOriginEmbedderPolicy* aResponseEmbedderPolicy) {
NS_IMETHODIMP HttpBaseChannel::GetResponseEmbedderPolicy(
nsILoadInfo::CrossOriginEmbedderPolicy* aOutPolicy) {
if (!mResponseHead) {
return NS_ERROR_NOT_AVAILABLE;
}
@ -4428,7 +4428,7 @@ nsresult HttpBaseChannel::GetResponseEmbedderPolicy(
policy = nsILoadInfo::EMBEDDER_POLICY_REQUIRE_CORP;
}
*aResponseEmbedderPolicy = policy;
*aOutPolicy = policy;
return NS_OK;
}

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

@ -318,6 +318,8 @@ class HttpBaseChannel : public nsHashPropertyBag,
NS_IMETHOD ComputeCrossOriginOpenerPolicy(
nsILoadInfo::CrossOriginOpenerPolicy aInitiatorPolicy,
nsILoadInfo::CrossOriginOpenerPolicy* aOutPolicy) override;
NS_IMETHOD GetResponseEmbedderPolicy(
nsILoadInfo::CrossOriginEmbedderPolicy* aOutPolicy) override;
virtual bool GetHasNonEmptySandboxingFlag() override {
return mHasNonEmptySandboxingFlag;
}
@ -592,9 +594,6 @@ class HttpBaseChannel : public nsHashPropertyBag,
bool MaybeWaitForUploadStreamLength(nsIStreamListener* aListener,
nsISupports* aContext);
nsresult GetResponseEmbedderPolicy(
nsILoadInfo::CrossOriginEmbedderPolicy* aResponseEmbedderPolicy);
void MaybeFlushConsoleReports();
bool IsBrowsingContextDiscarded() const;

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

@ -401,6 +401,9 @@ interface nsIHttpChannelInternal : nsISupports
nsILoadInfo_CrossOriginOpenerPolicy computeCrossOriginOpenerPolicy(
in nsILoadInfo_CrossOriginOpenerPolicy aInitiatorPolicy);
[noscript]
nsILoadInfo_CrossOriginEmbedderPolicy getResponseEmbedderPolicy();
[notxpcom, nostdcall] attribute boolean hasNonEmptySandboxingFlag;
[noscript, notxpcom, nostdcall]