зеркало из https://github.com/mozilla/pjs.git
Bug 633667: Per the spec, return NPRES_USER_BREAK when a plugin rejects an HTTP redirect, not NPRES_NETWORK_ERR. r=bsmedberg a=blocking2.0final+
This commit is contained in:
Родитель
1f8a163d65
Коммит
498f32cb77
|
@ -161,6 +161,7 @@ mIsSuspended(PR_FALSE),
|
|||
mIsPluginInitJSStream(mInst->mInPluginInitCall &&
|
||||
aURL && strncmp(aURL, "javascript:",
|
||||
sizeof("javascript:") - 1) == 0),
|
||||
mRedirectDenied(PR_FALSE),
|
||||
mResponseHeaderBuf(nsnull)
|
||||
{
|
||||
memset(&mNPStream, 0, sizeof(mNPStream));
|
||||
|
@ -770,6 +771,9 @@ nsNPAPIPluginStreamListener::OnStopBinding(nsIPluginStreamInfo* pluginInfo,
|
|||
// see bug 91140
|
||||
nsresult rv = NS_OK;
|
||||
NPReason reason = NS_FAILED(status) ? NPRES_NETWORK_ERR : NPRES_DONE;
|
||||
if (mRedirectDenied) {
|
||||
reason = NPRES_USER_BREAK;
|
||||
}
|
||||
if (mStreamType != NP_SEEK ||
|
||||
(NP_SEEK == mStreamType && NS_BINDING_ABORTED == status)) {
|
||||
rv = CleanUpStream(reason);
|
||||
|
@ -892,6 +896,7 @@ nsNPAPIPluginStreamListener::URLRedirectResponse(NPBool allow)
|
|||
{
|
||||
if (mHTTPRedirectCallback) {
|
||||
mHTTPRedirectCallback->OnRedirectVerifyCallback(allow ? NS_OK : NS_ERROR_FAILURE);
|
||||
mRedirectDenied = allow ? PR_FALSE : PR_TRUE;
|
||||
mHTTPRedirectCallback = nsnull;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,6 +150,7 @@ protected:
|
|||
PRPackedBool mCallNotify;
|
||||
PRPackedBool mIsSuspended;
|
||||
PRPackedBool mIsPluginInitJSStream;
|
||||
PRPackedBool mRedirectDenied;
|
||||
nsCString mResponseHeaders;
|
||||
char* mResponseHeaderBuf;
|
||||
nsCOMPtr<nsITimer> mDataPumpTimer;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
function test1() {
|
||||
expectedWriteURL = "";
|
||||
expectedNotifyStatus = 1;
|
||||
expectedNotifyStatus = 2;
|
||||
|
||||
p.streamTest(redirectingURL, false, null, writeCallback, notifyCallback, redirectCallback, false);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче