зеркало из https://github.com/mozilla/pjs.git
checking in part of the patch for 42224 that I forgot to check in previously. r=sfraser sr=darin a=shaver
This commit is contained in:
Родитель
9315967260
Коммит
1e6c46a82f
|
@ -36,6 +36,7 @@
|
|||
#include "nsICachingChannel.h"
|
||||
#include "nsILoadGroup.h"
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIMultiPartChannel.h"
|
||||
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIProxyObjectManager.h"
|
||||
|
@ -539,7 +540,11 @@ NS_IMETHODIMP imgRequest::OnStartRequest(nsIRequest *aRequest, nsISupports *ctxt
|
|||
open forever.
|
||||
*/
|
||||
if (!mChannel) {
|
||||
mChannel = do_QueryInterface(aRequest);
|
||||
nsCOMPtr<nsIMultiPartChannel> mpchan(do_QueryInterface(aRequest));
|
||||
if (mpchan)
|
||||
mpchan->GetBaseChannel(getter_AddRefs(mChannel));
|
||||
else
|
||||
mChannel = do_QueryInterface(aRequest);
|
||||
}
|
||||
|
||||
nsXPIDLCString mContentType;
|
||||
|
@ -588,6 +593,12 @@ NS_IMETHODIMP imgRequest::OnStartRequest(nsIRequest *aRequest, nsISupports *ctxt
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Shouldn't we be dead already if this gets hit? Probably multipart/x-mixed-replace...
|
||||
if (mObservers.Count() == 0) {
|
||||
this->Cancel(NS_IMAGELIB_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@ nsresult imgRequestProxy::Init(imgRequest *request, nsILoadGroup *aLoadGroup, im
|
|||
!(imageStatus & imgIRequest::STATUS_ERROR)) {
|
||||
aLoadGroup->AddRequest(this, cx);
|
||||
mLoadGroup = aLoadGroup;
|
||||
mIsInLoadGroup = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -361,6 +362,12 @@ void imgRequestProxy::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
|
|||
GetName(getter_Copies(name));
|
||||
LOG_FUNC_WITH_PARAM(gImgLog, "imgRequestProxy::OnStartRequest", "name", NS_ConvertUCS2toUTF8(name).get());
|
||||
#endif
|
||||
|
||||
if (!mIsInLoadGroup && mLoadGroup) {
|
||||
mLoadGroup->AddRequest(this, mContext);
|
||||
mIsInLoadGroup = PR_TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void imgRequestProxy::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult statusCode)
|
||||
|
@ -383,6 +390,6 @@ void imgRequestProxy::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsre
|
|||
nsCOMPtr<imgIRequest> kungFuDeathGrip(this);
|
||||
|
||||
mLoadGroup->RemoveRequest(this, mContext, statusCode);
|
||||
mLoadGroup = nsnull;
|
||||
mIsInLoadGroup = PR_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,8 @@ private:
|
|||
nsCOMPtr<nsILoadGroup> mLoadGroup;
|
||||
|
||||
nsLoadFlags mLoadFlags;
|
||||
PRBool mCanceled;
|
||||
PRPackedBool mCanceled;
|
||||
PRPackedBool mIsInLoadGroup;
|
||||
|
||||
PRLock *mLock;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче