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:
Ehsan Akhgari 2015-08-18 15:28:46 -04:00
parent 9d0e4e2cdb
commit 5816445c61
5 changed files with 22 additions and 1 deletions

View File

@ -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,

View File

@ -149,6 +149,8 @@ protected:
bool GetAssociatedContentSecurity(nsIAssociatedContentSecurity** res = nullptr);
virtual void DoNotifyListenerCleanup() override;
NS_IMETHOD GetResponseSynthesized(bool* aSynthesized) override;
private:
nsresult ContinueAsyncOpen();

View File

@ -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()
{

View File

@ -233,6 +233,7 @@ public: /* internal necko use only */
};
void MarkIntercepted();
NS_IMETHOD GetResponseSynthesized(bool* aSynthesized) override;
bool AwaitingCacheCallbacks();
protected:

View File

@ -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