mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Bug 1194847 - Part 1: Make it possible to tell whether the response of a channel has been synthesized; r=michal
This commit is contained in:
parent
9d0e4e2cdb
commit
5816445c61
@ -2180,6 +2180,14 @@ HttpChannelChild::ResetInterception()
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HttpChannelChild::GetResponseSynthesized(bool* aSynthesized)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSynthesized);
|
||||
*aSynthesized = mSynthesizedResponse;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
HttpChannelChild::OverrideWithSynthesizedResponse(nsAutoPtr<nsHttpResponseHead>& aResponseHead,
|
||||
nsIInputStream* aSynthesizedInput,
|
||||
|
@ -149,6 +149,8 @@ protected:
|
||||
bool GetAssociatedContentSecurity(nsIAssociatedContentSecurity** res = nullptr);
|
||||
virtual void DoNotifyListenerCleanup() override;
|
||||
|
||||
NS_IMETHOD GetResponseSynthesized(bool* aSynthesized) override;
|
||||
|
||||
private:
|
||||
nsresult ContinueAsyncOpen();
|
||||
|
||||
|
@ -6874,6 +6874,14 @@ nsHttpChannel::MarkIntercepted()
|
||||
mInterceptCache = INTERCEPTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHttpChannel::GetResponseSynthesized(bool* aSynthesized)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSynthesized);
|
||||
*aSynthesized = (mInterceptCache == INTERCEPTED);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
nsHttpChannel::AwaitingCacheCallbacks()
|
||||
{
|
||||
|
@ -233,6 +233,7 @@ public: /* internal necko use only */
|
||||
};
|
||||
|
||||
void MarkIntercepted();
|
||||
NS_IMETHOD GetResponseSynthesized(bool* aSynthesized) override;
|
||||
bool AwaitingCacheCallbacks();
|
||||
|
||||
protected:
|
||||
|
@ -38,7 +38,7 @@ interface nsIHttpUpgradeListener : nsISupports
|
||||
* using any feature exposed by this interface, be aware that this interface
|
||||
* will change and you will be broken. You have been warned.
|
||||
*/
|
||||
[scriptable, uuid(4c9e681e-efd8-4ed2-b57f-20d48c9b3c3b)]
|
||||
[scriptable, uuid(c4fab96f-0b10-4b14-b45b-517fc3f36842)]
|
||||
|
||||
interface nsIHttpChannelInternal : nsISupports
|
||||
{
|
||||
@ -221,6 +221,8 @@ interface nsIHttpChannelInternal : nsISupports
|
||||
*/
|
||||
void forceNoIntercept();
|
||||
|
||||
readonly attribute boolean responseSynthesized;
|
||||
|
||||
/**
|
||||
* Set by nsCORSListenerProxy if credentials should be included in
|
||||
* cross-origin requests. false indicates "same-origin", users should still
|
||||
|
Loading…
Reference in New Issue
Block a user