mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 662534 - Let imgRequestProxy implement nsITimedChannel, r=joe
This commit is contained in:
parent
3aa3bd7fb7
commit
3c214fe898
@ -226,6 +226,8 @@ nsresult imgRequest::Init(nsIURI *aURI,
|
||||
mKeyURI = aKeyURI;
|
||||
mRequest = aRequest;
|
||||
mChannel = aChannel;
|
||||
mTimedChannel = do_QueryInterface(mChannel);
|
||||
|
||||
mChannel->GetNotificationCallbacks(getter_AddRefs(mPrevChannelSink));
|
||||
|
||||
NS_ASSERTION(mPrevChannelSink != this,
|
||||
@ -956,6 +958,7 @@ NS_IMETHODIMP imgRequest::OnStopRequest(nsIRequest *aRequest, nsISupports *ctxt,
|
||||
statusTracker.SendStopRequest(srIter.GetNext(), lastPart, status);
|
||||
}
|
||||
|
||||
mTimedChannel = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1277,6 +1280,7 @@ imgRequest::OnRedirectVerifyCallback(nsresult result)
|
||||
}
|
||||
|
||||
mChannel = mNewRedirectChannel;
|
||||
mTimedChannel = do_QueryInterface(mChannel);
|
||||
mNewRedirectChannel = nsnull;
|
||||
|
||||
// Don't make any cache changes if we're going to point to the same thing. We
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsITimedChannel.h"
|
||||
|
||||
#include "nsCategoryCache.h"
|
||||
#include "nsCOMPtr.h"
|
||||
@ -219,6 +220,8 @@ private:
|
||||
|
||||
nsTObserverArray<imgRequestProxy*> mObservers;
|
||||
|
||||
nsCOMPtr<nsITimedChannel> mTimedChannel;
|
||||
|
||||
nsCString mContentType;
|
||||
|
||||
nsRefPtr<imgCacheEntry> mCacheEntry; /* we hold on to this to this so long as we have observers */
|
||||
|
@ -57,8 +57,17 @@
|
||||
|
||||
using namespace mozilla::imagelib;
|
||||
|
||||
NS_IMPL_ISUPPORTS4(imgRequestProxy, imgIRequest, nsIRequest,
|
||||
nsISupportsPriority, nsISecurityInfoProvider)
|
||||
NS_IMPL_ADDREF(imgRequestProxy)
|
||||
NS_IMPL_RELEASE(imgRequestProxy)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(imgRequestProxy)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, imgIRequest)
|
||||
NS_INTERFACE_MAP_ENTRY(imgIRequest)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIRequest)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsPriority)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISecurityInfoProvider)
|
||||
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsITimedChannel, TimedChannel() != nsnull)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
imgRequestProxy::imgRequestProxy() :
|
||||
mOwner(nsnull),
|
||||
|
@ -48,6 +48,7 @@
|
||||
#include "nsIChannel.h"
|
||||
#include "nsILoadGroup.h"
|
||||
#include "nsISupportsPriority.h"
|
||||
#include "nsITimedChannel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsThreadUtils.h"
|
||||
@ -71,7 +72,10 @@ class Image;
|
||||
} // namespace imagelib
|
||||
} // namespace mozilla
|
||||
|
||||
class imgRequestProxy : public imgIRequest, public nsISupportsPriority, public nsISecurityInfoProvider
|
||||
class imgRequestProxy : public imgIRequest,
|
||||
public nsISupportsPriority,
|
||||
public nsISecurityInfoProvider,
|
||||
public nsITimedChannel
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -79,6 +83,7 @@ public:
|
||||
NS_DECL_NSIREQUEST
|
||||
NS_DECL_NSISUPPORTSPRIORITY
|
||||
NS_DECL_NSISECURITYINFOPROVIDER
|
||||
// nsITimedChannel declared below
|
||||
|
||||
imgRequestProxy();
|
||||
virtual ~imgRequestProxy();
|
||||
@ -196,6 +201,16 @@ protected:
|
||||
// (b) whether mOwner has instantiated its image yet
|
||||
imgStatusTracker& GetStatusTracker();
|
||||
|
||||
nsITimedChannel* TimedChannel()
|
||||
{
|
||||
if (!mOwner)
|
||||
return nsnull;
|
||||
return mOwner->mTimedChannel;
|
||||
}
|
||||
|
||||
public:
|
||||
NS_FORWARD_SAFE_NSITIMEDCHANNEL(TimedChannel())
|
||||
|
||||
private:
|
||||
friend class imgCacheValidator;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user