mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1169296 - Intercepting top-level document loads is not working with JAR channels. r=jdm
This commit is contained in:
parent
eaea331c4f
commit
b999a63de7
@ -890,7 +890,7 @@ void nsJARChannel::ResetInterception()
|
||||
{
|
||||
LOG(("nsJARChannel::ResetInterception [this=%x]\n", this));
|
||||
|
||||
// Continue with the origin request.
|
||||
// Continue with the original request.
|
||||
nsresult rv = ContinueAsyncOpen();
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
}
|
||||
@ -917,6 +917,8 @@ nsJARChannel::OverrideWithSynthesizedResponse(nsIInputStream* aSynthesizedInput)
|
||||
return;
|
||||
}
|
||||
|
||||
FinishAsyncOpen();
|
||||
|
||||
rv = mSynthesizedResponsePump->AsyncRead(this, nullptr);
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
}
|
||||
@ -952,6 +954,14 @@ nsJARChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctx)
|
||||
nsRefPtr<InterceptedJARChannel> intercepted =
|
||||
new InterceptedJARChannel(this, controller, isNavigation);
|
||||
intercepted->NotifyController();
|
||||
|
||||
// We get the JAREntry so we can infer the content type later in case
|
||||
// that it isn't provided along with the synthesized response.
|
||||
nsresult rv = mJarURI->GetJAREntry(mJarEntry);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1007,11 +1017,18 @@ nsJARChannel::ContinueAsyncOpen()
|
||||
}
|
||||
|
||||
|
||||
FinishAsyncOpen();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsJARChannel::FinishAsyncOpen()
|
||||
{
|
||||
if (mLoadGroup)
|
||||
mLoadGroup->AddRequest(this, nullptr);
|
||||
|
||||
mOpened = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -82,7 +82,10 @@ private:
|
||||
// Returns true if this channel should intercept the network request and
|
||||
// prepare for a possible synthesized response instead.
|
||||
bool ShouldIntercept();
|
||||
|
||||
nsresult ContinueAsyncOpen();
|
||||
void FinishAsyncOpen();
|
||||
|
||||
// Discard the prior interception and continue with the original network
|
||||
// request.
|
||||
void ResetInterception();
|
||||
|
Loading…
Reference in New Issue
Block a user