Backed out changeset 75709d46ba3b (bug 1137037)

This commit is contained in:
Ryan VanderMeulen 2015-03-10 16:43:54 -04:00
Родитель 48668314ac
Коммит 2c63c17f19
4 изменённых файлов: 17 добавлений и 15 удалений

Просмотреть файл

@ -28,6 +28,7 @@
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsIFileURL.h"
#include "nsCRT.h"
#include "nsIDocument.h"
#include "nsINetworkPredictor.h"
#include "nsIApplicationCache.h"
@ -2045,6 +2046,12 @@ nsresult imgLoader::LoadImage(nsIURI *aURI,
timedChannel->SetInitiatorType(initiatorType);
}
// Pass the inner window ID of the loading document, if possible.
nsCOMPtr<nsIDocument> doc = do_QueryInterface(aCX);
if (doc) {
request->SetInnerWindowID(doc->InnerWindowID());
}
// create the proxy listener
nsCOMPtr<nsIStreamListener> pl = new ProxyListener(request.get());
@ -2508,8 +2515,7 @@ NS_IMPL_ISUPPORTS(imgCacheValidator, nsIStreamListener, nsIRequestObserver,
imgCacheValidator::imgCacheValidator(nsProgressNotificationProxy* progress,
imgLoader* loader, imgRequest *request,
nsISupports* aContext,
bool forcePrincipalCheckForCacheEntry)
void *aContext, bool forcePrincipalCheckForCacheEntry)
: mProgressProxy(progress),
mRequest(request),
mContext(aContext),

Просмотреть файл

@ -497,8 +497,7 @@ class imgCacheValidator : public nsIStreamListener,
{
public:
imgCacheValidator(nsProgressNotificationProxy* progress, imgLoader* loader,
imgRequest* aRequest, nsISupports* aContext,
bool forcePrincipalCheckForCacheEntry);
imgRequest *request, void *aContext, bool forcePrincipalCheckForCacheEntry);
void AddProxy(imgRequestProxy *aProxy);
@ -524,7 +523,7 @@ private:
nsRefPtr<imgRequest> mNewRequest;
nsRefPtr<imgCacheEntry> mNewEntry;
nsCOMPtr<nsISupports> mContext;
void *mContext;
imgLoader* mImgLoader;
};

Просмотреть файл

@ -18,7 +18,6 @@
#include "nsIChannel.h"
#include "nsICachingChannel.h"
#include "nsIDocument.h"
#include "nsIThreadRetargetableRequest.h"
#include "nsIInputStream.h"
#include "nsIMultiPartChannel.h"
@ -96,7 +95,7 @@ nsresult imgRequest::Init(nsIURI *aURI,
nsIRequest *aRequest,
nsIChannel *aChannel,
imgCacheEntry *aCacheEntry,
nsISupports* aCX,
void *aLoadId,
nsIPrincipal* aLoadingPrincipal,
int32_t aCORSMode,
ReferrerPolicy aReferrerPolicy)
@ -133,13 +132,7 @@ nsresult imgRequest::Init(nsIURI *aURI,
mCacheEntry = aCacheEntry;
SetLoadId(aCX);
// Grab the inner window ID of the loading document, if possible.
nsCOMPtr<nsIDocument> doc = do_QueryInterface(aCX);
if (doc) {
mInnerWindowId = doc->InnerWindowID();
}
SetLoadId(aLoadId);
return NS_OK;
}

Просмотреть файл

@ -65,7 +65,7 @@ public:
nsIRequest *aRequest,
nsIChannel *aChannel,
imgCacheEntry *aCacheEntry,
nsISupports* aCX,
void *aLoadId,
nsIPrincipal* aLoadingPrincipal,
int32_t aCORSMode,
ReferrerPolicy aReferrerPolicy);
@ -91,6 +91,10 @@ public:
// Request that we start decoding the image as soon as data becomes available.
void RequestDecode() { mDecodeRequested = true; }
inline void SetInnerWindowID(uint64_t aInnerWindowId) {
mInnerWindowId = aInnerWindowId;
}
inline uint64_t InnerWindowID() const {
return mInnerWindowId;
}