fixing multipartmixed image stuff. bug 42224. r=sfraser sr=darin a=shaver

git-svn-id: svn://10.0.0.236/trunk@115383 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pavlov%netscape.com 2002-02-27 00:32:19 +00:00
parent 76df730fa8
commit b95b10fb11
4 changed files with 20 additions and 2 deletions

View File

@ -819,5 +819,8 @@ term_source (j_decompress_ptr jd)
src->decoder->mObserver->OnStopDecode(nsnull, nsnull, NS_OK, nsnull);
}
src->decoder->mFrame->SetMutable(PR_FALSE);
PRBool isMutable = PR_FALSE;
if (src->decoder->mImageLoad)
src->decoder->mImageLoad->GetIsMultiPartChannel(&isMutable);
src->decoder->mFrame->SetMutable(isMutable);
}

View File

@ -41,4 +41,5 @@ interface imgILoad : nsISupports
* @attention NEED DOCS
*/
attribute imgIContainer image;
readonly attribute PRBool isMultiPartChannel;
};

View File

@ -58,7 +58,7 @@ imgRequest::imgRequest() :
mObservers(0),
mLoading(PR_FALSE), mProcessing(PR_FALSE),
mImageStatus(imgIRequest::STATUS_NONE), mState(0),
mContentType(nsnull), mCacheId(0), mValidator(nsnull)
mContentType(nsnull), mCacheId(0), mValidator(nsnull), mIsMultiPartChannel(PR_FALSE)
{
NS_INIT_ISUPPORTS();
/* member initializers and constructor code */
@ -307,6 +307,14 @@ NS_IMETHODIMP imgRequest::GetImage(imgIContainer **aImage)
return NS_OK;
}
NS_IMETHODIMP imgRequest::GetIsMultiPartChannel(PRBool *aIsMultiPartChannel)
{
LOG_FUNC(gImgLog, "imgRequest::GetIsMultiPartChannel");
*aIsMultiPartChannel = mIsMultiPartChannel;
return NS_OK;
}
/** imgIContainerObserver methods **/
@ -534,6 +542,11 @@ NS_IMETHODIMP imgRequest::OnStartRequest(nsIRequest *aRequest, nsISupports *ctxt
mChannel = do_QueryInterface(aRequest);
}
nsXPIDLCString mContentType;
mChannel->GetContentType(getter_Copies(mContentType));
if (PL_strcasecmp("multipart/x-mixed-replace", mContentType.get()) == 0)
mIsMultiPartChannel = PR_TRUE;
/* set our state variables to their initial values. */
mImageStatus = imgIRequest::STATUS_NONE;
mState = 0;

View File

@ -128,6 +128,7 @@ private:
PRTime mLoadTime;
httpValidateChecker *mValidator;
PRBool mIsMultiPartChannel;
};
#endif