зеркало из https://github.com/mozilla/gecko-dev.git
Bug 855712 - Remove trailing whitespaces in image/src/*cpp. r=jmuizelaar
This commit is contained in:
Родитель
48f475a655
Коммит
390ad04106
|
@ -18,7 +18,7 @@ namespace mozilla {
|
|||
};
|
||||
|
||||
// The length of the bitmap file header as defined in the BMP spec.
|
||||
#define BFH_LENGTH 14
|
||||
#define BFH_LENGTH 14
|
||||
// Internally we store the bitmap file header with an additional 4 bytes which
|
||||
// is used to store the bitmap information header size.
|
||||
#define BFH_INTERNAL_LENGTH 18
|
||||
|
|
|
@ -33,7 +33,7 @@ ImageResource::SizeOfData()
|
|||
{
|
||||
if (mError)
|
||||
return 0;
|
||||
|
||||
|
||||
// This is not used by memory reporters, but for sizing the cache, which is
|
||||
// why it uses |moz_malloc_size_of| rather than an
|
||||
// |NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN|.
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
|
||||
/**
|
||||
* The components that make up SizeOfData().
|
||||
*/
|
||||
*/
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const = 0;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const = 0;
|
||||
virtual size_t NonHeapSizeOfDecoded() const = 0;
|
||||
|
|
|
@ -729,7 +729,7 @@ RasterImage::ExtractFrame(uint32_t aWhichFrame,
|
|||
|
||||
if (!ApplyDecodeFlags(aFlags))
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
|
||||
// If a synchronous decode was requested, do it
|
||||
if (aFlags & FLAG_SYNC_DECODE) {
|
||||
rv = SyncDecode();
|
||||
|
@ -1167,7 +1167,7 @@ RasterImage::GetCurrentImage()
|
|||
ImageFormat cairoFormat = CAIRO_SURFACE;
|
||||
nsRefPtr<layers::Image> image = mImageContainer->CreateImage(&cairoFormat, 1);
|
||||
NS_ASSERTION(image, "Failed to create Image");
|
||||
|
||||
|
||||
NS_ASSERTION(image->GetFormat() == cairoFormat, "Wrong format");
|
||||
static_cast<CairoImage*>(image.get())->SetData(cairoData);
|
||||
|
||||
|
@ -1221,7 +1221,7 @@ RasterImage::UpdateImageContainer()
|
|||
size_t
|
||||
RasterImage::HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
{
|
||||
// n == 0 is possible for two reasons.
|
||||
// n == 0 is possible for two reasons.
|
||||
// - This is a zero-length image.
|
||||
// - We're on a platform where moz_malloc_size_of always returns 0.
|
||||
// In either case the fallback works appropriately.
|
||||
|
@ -1342,14 +1342,14 @@ RasterImage::InternalAddFrame(uint32_t framenum,
|
|||
}
|
||||
|
||||
if (mFrames.Length() == 0) {
|
||||
return InternalAddFrameHelper(framenum, frame.forget(), imageData, imageLength,
|
||||
return InternalAddFrameHelper(framenum, frame.forget(), imageData, imageLength,
|
||||
paletteData, paletteLength, aRetFrame);
|
||||
}
|
||||
|
||||
if (mFrames.Length() == 1) {
|
||||
// Since we're about to add our second frame, initialize animation stuff
|
||||
EnsureAnimExists();
|
||||
|
||||
|
||||
// If we dispose of the first frame by clearing it, then the
|
||||
// First Frame's refresh area is all of itself.
|
||||
// RESTORE_PREVIOUS is invalid (assumed to be DISPOSE_CLEAR)
|
||||
|
@ -1363,15 +1363,15 @@ RasterImage::InternalAddFrame(uint32_t framenum,
|
|||
// Some gifs are huge but only have a small area that they animate
|
||||
// We only need to refresh that small area when Frame 0 comes around again
|
||||
nsIntRect frameRect = frame->GetRect();
|
||||
mAnim->firstFrameRefreshArea.UnionRect(mAnim->firstFrameRefreshArea,
|
||||
mAnim->firstFrameRefreshArea.UnionRect(mAnim->firstFrameRefreshArea,
|
||||
frameRect);
|
||||
|
||||
|
||||
rv = InternalAddFrameHelper(framenum, frame.forget(), imageData, imageLength,
|
||||
paletteData, paletteLength, aRetFrame);
|
||||
|
||||
|
||||
// We may be able to start animating, if we now have enough frames
|
||||
EvaluateAnimation();
|
||||
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -1457,13 +1457,13 @@ RasterImage::EnsureFrame(uint32_t aFrameNum, int32_t aX, int32_t aY,
|
|||
|
||||
// Adding a frame that doesn't already exist.
|
||||
if (aFrameNum == mFrames.Length())
|
||||
return InternalAddFrame(aFrameNum, aX, aY, aWidth, aHeight, aFormat,
|
||||
return InternalAddFrame(aFrameNum, aX, aY, aWidth, aHeight, aFormat,
|
||||
aPaletteDepth, imageData, imageLength,
|
||||
paletteData, paletteLength, aRetFrame);
|
||||
|
||||
imgFrame *frame = GetImgFrameNoDecode(aFrameNum);
|
||||
if (!frame)
|
||||
return InternalAddFrame(aFrameNum, aX, aY, aWidth, aHeight, aFormat,
|
||||
return InternalAddFrame(aFrameNum, aX, aY, aWidth, aHeight, aFormat,
|
||||
aPaletteDepth, imageData, imageLength,
|
||||
paletteData, paletteLength, aRetFrame);
|
||||
|
||||
|
@ -1527,7 +1527,7 @@ RasterImage::FrameUpdated(uint32_t aFrameNum, nsIntRect &aUpdatedRect)
|
|||
NS_ABORT_IF_FALSE(frame, "Calling FrameUpdated on frame that doesn't exist!");
|
||||
|
||||
frame->ImageUpdated(aUpdatedRect);
|
||||
|
||||
|
||||
if (aFrameNum == GetCurrentImgFrameIndex() &&
|
||||
!IsInUpdateImageContainer()) {
|
||||
mImageContainer = nullptr;
|
||||
|
@ -1613,7 +1613,7 @@ RasterImage::StartAnimation()
|
|||
// this is used in AdvanceFrame().
|
||||
mAnim->currentAnimationFrameTime = TimeStamp::Now();
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1638,7 +1638,7 @@ RasterImage::ResetAnimation()
|
|||
if (mError)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (mAnimationMode == kDontAnimMode ||
|
||||
if (mAnimationMode == kDontAnimMode ||
|
||||
!mAnim || mAnim->currentAnimationFrameIndex == 0)
|
||||
return NS_OK;
|
||||
|
||||
|
@ -1893,7 +1893,7 @@ RasterImage::OnImageDataAvailable(nsIRequest*,
|
|||
uint32_t aCount)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
|
||||
// WriteToRasterImage always consumes everything it gets
|
||||
// if it doesn't run out of memory
|
||||
uint32_t bytesRead;
|
||||
|
@ -1986,7 +1986,7 @@ RasterImage::DoComposite(nsIntRect* aDirtyRect,
|
|||
|
||||
// Optimization: DisposeClearAll if the previous frame is the same size as
|
||||
// container and it's clearing itself
|
||||
if (isFullPrevFrame &&
|
||||
if (isFullPrevFrame &&
|
||||
(prevFrameDisposalMethod == kDisposeClear))
|
||||
prevFrameDisposalMethod = kDisposeClearAll;
|
||||
|
||||
|
@ -2003,7 +2003,7 @@ RasterImage::DoComposite(nsIntRect* aDirtyRect,
|
|||
aDirtyRect->SetRect(0, 0, mSize.width, mSize.height);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Optimization: Skip compositing if this frame is the same size as the
|
||||
// container and it's fully drawing over prev frame (no alpha)
|
||||
if (isFullNextFrame &&
|
||||
|
@ -2067,22 +2067,22 @@ RasterImage::DoComposite(nsIntRect* aDirtyRect,
|
|||
needToBlankComposite = true;
|
||||
} else if (aNextFrameIndex != mAnim->lastCompositedFrameIndex+1) {
|
||||
|
||||
// If we are not drawing on top of last composited frame,
|
||||
// If we are not drawing on top of last composited frame,
|
||||
// then we are building a new composite frame, so let's clear it first.
|
||||
needToBlankComposite = true;
|
||||
}
|
||||
|
||||
// More optimizations possible when next frame is not transparent
|
||||
// But if the next frame has kDisposeRestorePrevious,
|
||||
// this "no disposal" optimization is not possible,
|
||||
// because the frame in "after disposal operation" state
|
||||
// needs to be stored in compositingFrame, so it can be
|
||||
// this "no disposal" optimization is not possible,
|
||||
// because the frame in "after disposal operation" state
|
||||
// needs to be stored in compositingFrame, so it can be
|
||||
// copied into compositingPrevFrame later.
|
||||
bool doDisposal = true;
|
||||
if (!aNextFrame->GetHasAlpha() &&
|
||||
nextFrameDisposalMethod != kDisposeRestorePrevious) {
|
||||
if (isFullNextFrame) {
|
||||
// Optimization: No need to dispose prev.frame when
|
||||
// Optimization: No need to dispose prev.frame when
|
||||
// next frame is full frame and not transparent.
|
||||
doDisposal = false;
|
||||
// No need to blank the composite frame
|
||||
|
@ -2092,11 +2092,11 @@ RasterImage::DoComposite(nsIntRect* aDirtyRect,
|
|||
(prevFrameRect.y >= nextFrameRect.y) &&
|
||||
(prevFrameRect.x + prevFrameRect.width <= nextFrameRect.x + nextFrameRect.width) &&
|
||||
(prevFrameRect.y + prevFrameRect.height <= nextFrameRect.y + nextFrameRect.height)) {
|
||||
// Optimization: No need to dispose prev.frame when
|
||||
// Optimization: No need to dispose prev.frame when
|
||||
// next frame fully overlaps previous frame.
|
||||
doDisposal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (doDisposal) {
|
||||
|
@ -2112,17 +2112,17 @@ RasterImage::DoComposite(nsIntRect* aDirtyRect,
|
|||
ClearFrame(mAnim->compositingFrame, prevFrameRect);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case kDisposeClearAll:
|
||||
ClearFrame(mAnim->compositingFrame);
|
||||
break;
|
||||
|
||||
|
||||
case kDisposeRestorePrevious:
|
||||
// It would be better to copy only the area changed back to
|
||||
// compositingFrame.
|
||||
if (mAnim->compositingPrevFrame) {
|
||||
CopyFrameImage(mAnim->compositingPrevFrame, mAnim->compositingFrame);
|
||||
|
||||
|
||||
// destroy only if we don't need it for this frame's disposal
|
||||
if (nextFrameDisposalMethod != kDisposeRestorePrevious)
|
||||
mAnim->compositingPrevFrame = nullptr;
|
||||
|
@ -2130,7 +2130,7 @@ RasterImage::DoComposite(nsIntRect* aDirtyRect,
|
|||
ClearFrame(mAnim->compositingFrame);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
// Copy previous frame into compositingFrame before we put the new frame on top
|
||||
// Assumes that the previous frame represents a full frame (it could be
|
||||
|
@ -2195,9 +2195,9 @@ RasterImage::DoComposite(nsIntRect* aDirtyRect,
|
|||
}
|
||||
|
||||
// We don't want to keep composite images for 8bit frames.
|
||||
// Also this optimization won't work if the next frame has
|
||||
// kDisposeRestorePrevious, because it would need to be restored
|
||||
// into "after prev disposal but before next blend" state,
|
||||
// Also this optimization won't work if the next frame has
|
||||
// kDisposeRestorePrevious, because it would need to be restored
|
||||
// into "after prev disposal but before next blend" state,
|
||||
// not into empty frame.
|
||||
if (isFullNextFrame && mAnimationMode == kNormalAnimMode && mLoopCount != 0 &&
|
||||
nextFrameDisposalMethod != kDisposeRestorePrevious &&
|
||||
|
@ -2301,7 +2301,7 @@ RasterImage::CopyFrameImage(imgFrame *aSrcFrame,
|
|||
}
|
||||
|
||||
//******************************************************************************
|
||||
/*
|
||||
/*
|
||||
* aSrc is the current frame being drawn,
|
||||
* aDst is the composition frame where the current frame is drawn into.
|
||||
* aSrcRect is the size of the current frame, and the position of that frame
|
||||
|
@ -2397,7 +2397,7 @@ RasterImage::DrawFrameTo(imgFrame *aSrc,
|
|||
gfxContext dst(dstSurf);
|
||||
dst.Translate(gfxPoint(aSrcRect.x, aSrcRect.y));
|
||||
dst.Rectangle(gfxRect(0, 0, aSrcRect.width, aSrcRect.height), true);
|
||||
|
||||
|
||||
// first clear the surface if the blend flag says so
|
||||
int32_t blendMethod = aSrc->GetBlendMethod();
|
||||
if (blendMethod == kBlendSource) {
|
||||
|
@ -2555,7 +2555,7 @@ RasterImage::InitDecoder(bool aDoSizeDecode, bool aIsSynchronous /* = false */)
|
|||
{
|
||||
// Ensure that the decoder is not already initialized
|
||||
NS_ABORT_IF_FALSE(!mDecoder, "Calling InitDecoder() while already decoding!");
|
||||
|
||||
|
||||
// We shouldn't be firing up a decoder if we already have the frames decoded
|
||||
NS_ABORT_IF_FALSE(!mDecoded, "Calling InitDecoder() but already decoded!");
|
||||
|
||||
|
@ -2653,7 +2653,7 @@ RasterImage::InitDecoder(bool aDoSizeDecode, bool aIsSynchronous /* = false */)
|
|||
// Flushes, closes, and nulls-out a decoder. Cleans up any related decoding
|
||||
// state. It is an error to call this function when there is no initialized
|
||||
// decoder.
|
||||
//
|
||||
//
|
||||
// aIntent specifies the intent of the shutdown. If aIntent is
|
||||
// eShutdownIntent_Done, an error is flagged if we didn't get what we should
|
||||
// have out of the decode. If aIntent is eShutdownIntent_NotNeeded, we don't
|
||||
|
|
|
@ -81,7 +81,7 @@ class nsIThreadPool;
|
|||
*
|
||||
* @par
|
||||
* Each frame can have a different method of removing itself. These are
|
||||
* listed as imgIContainer::cDispose... constants. Notify() calls
|
||||
* listed as imgIContainer::cDispose... constants. Notify() calls
|
||||
* DoComposite() to handle any special frame destruction.
|
||||
*
|
||||
* @par
|
||||
|
@ -612,7 +612,7 @@ private:
|
|||
*
|
||||
* Does not change the size of mFrames.
|
||||
*
|
||||
* @param framenum The index of the frame to be deleted.
|
||||
* @param framenum The index of the frame to be deleted.
|
||||
* Must lie in [0, mFrames.Length() )
|
||||
*/
|
||||
void DeleteImgFrame(uint32_t framenum);
|
||||
|
@ -637,7 +637,7 @@ private:
|
|||
|
||||
// We don't support discarding animated images (See bug 414259).
|
||||
// Lock the image and throw away the key.
|
||||
//
|
||||
//
|
||||
// Note that this is inefficient, since we could get rid of the source
|
||||
// data too. However, doing this is actually hard, because we're probably
|
||||
// calling ensureAnimExists mid-decode, and thus we're decoding out of
|
||||
|
@ -673,11 +673,11 @@ private:
|
|||
|
||||
//! @overload
|
||||
static void ClearFrame(imgFrame* aFrame, nsIntRect &aRect);
|
||||
|
||||
|
||||
//! Copy one frames's image and mask into another
|
||||
static bool CopyFrameImage(imgFrame *aSrcFrame,
|
||||
imgFrame *aDstFrame);
|
||||
|
||||
|
||||
/** Draws one frames's image to into another,
|
||||
* at the position specified by aRect
|
||||
*
|
||||
|
@ -728,21 +728,21 @@ private: // data
|
|||
uint32_t mFrameDecodeFlags;
|
||||
|
||||
//! All the frames of the image
|
||||
// IMPORTANT: if you use mFrames in a method, call EnsureImageIsDecoded() first
|
||||
// IMPORTANT: if you use mFrames in a method, call EnsureImageIsDecoded() first
|
||||
// to ensure that the frames actually exist (they may have been discarded to save
|
||||
// memory, or we may be decoding on draw).
|
||||
nsTArray<imgFrame *> mFrames;
|
||||
|
||||
|
||||
nsCOMPtr<nsIProperties> mProperties;
|
||||
|
||||
// IMPORTANT: if you use mAnim in a method, call EnsureImageIsDecoded() first to ensure
|
||||
// that the frames actually exist (they may have been discarded to save memory, or
|
||||
// we maybe decoding on draw).
|
||||
RasterImage::Anim* mAnim;
|
||||
|
||||
|
||||
//! # loops remaining before animation stops (-1 no stop)
|
||||
int32_t mLoopCount;
|
||||
|
||||
|
||||
// Discard members
|
||||
uint32_t mLockCount;
|
||||
DiscardTracker::Node mDiscardTrackerNode;
|
||||
|
|
|
@ -124,7 +124,7 @@ SVGDocumentWrapper::UpdateViewportBounds(const nsIntSize& aViewportSize)
|
|||
|
||||
nsIntRect currentBounds;
|
||||
mViewer->GetBounds(currentBounds);
|
||||
|
||||
|
||||
// If the bounds have changed, we need to do a layout flush.
|
||||
if (currentBounds.Size() != aViewportSize) {
|
||||
mViewer->SetBounds(nsIntRect(nsIntPoint(0, 0), aViewportSize));
|
||||
|
|
|
@ -117,7 +117,7 @@ public:
|
|||
}
|
||||
|
||||
~SVGParseCompleteListener()
|
||||
{
|
||||
{
|
||||
if (mDocument) {
|
||||
// The document must have been destroyed before we got our event.
|
||||
// Otherwise this can't happen, since documents hold strong references to
|
||||
|
@ -750,7 +750,7 @@ VectorImage::Draw(gfxContext* aContext,
|
|||
subimage, sourceRect, imageRect, aFill,
|
||||
gfxASurface::ImageFormatARGB32, aFilter);
|
||||
|
||||
MOZ_ASSERT(mRenderingObserver || mHaveRestrictedRegion,
|
||||
MOZ_ASSERT(mRenderingObserver || mHaveRestrictedRegion,
|
||||
"Should have a rendering observer by now unless ExtractFrame created us");
|
||||
if (mRenderingObserver) {
|
||||
// Allow ourselves to fire FrameChanged and OnStopFrame again.
|
||||
|
|
|
@ -146,7 +146,7 @@ imgFrame::~imgFrame()
|
|||
}
|
||||
}
|
||||
|
||||
nsresult imgFrame::Init(int32_t aX, int32_t aY, int32_t aWidth, int32_t aHeight,
|
||||
nsresult imgFrame::Init(int32_t aX, int32_t aY, int32_t aWidth, int32_t aHeight,
|
||||
gfxASurface::gfxImageFormat aFormat, uint8_t aPaletteDepth /* = 0 */)
|
||||
{
|
||||
// assert for properties that should be verified by decoders, warn for properties related to bad content
|
||||
|
@ -492,7 +492,7 @@ nsresult imgFrame::Extract(const nsIntRect& aRegion, imgFrame** aResult)
|
|||
// (albeit slower) Cairo fallback scaler will be used.
|
||||
subImage->mNeverUseDeviceSurface = true;
|
||||
|
||||
nsresult rv = subImage->Init(0, 0, aRegion.width, aRegion.height,
|
||||
nsresult rv = subImage->Init(0, 0, aRegion.width, aRegion.height,
|
||||
mFormat, mPaletteDepth);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
// we want to explore making the document own the load group
|
||||
// so we can associate the document URI with the load group.
|
||||
// until this point, we have an evil hack:
|
||||
#include "nsIHttpChannelInternal.h"
|
||||
#include "nsIHttpChannelInternal.h"
|
||||
#include "nsIContentSecurityPolicy.h"
|
||||
#include "nsIChannelPolicy.h"
|
||||
#include "nsILoadContext.h"
|
||||
|
@ -391,8 +391,8 @@ static bool ShouldRevalidateEntry(imgCacheEntry *aEntry,
|
|||
// entries to be used unless they have been explicitly marked to
|
||||
// indicate that revalidation is necessary.
|
||||
//
|
||||
if (aFlags & (nsIRequest::VALIDATE_NEVER |
|
||||
nsIRequest::VALIDATE_ONCE_PER_SESSION))
|
||||
if (aFlags & (nsIRequest::VALIDATE_NEVER |
|
||||
nsIRequest::VALIDATE_ONCE_PER_SESSION))
|
||||
{
|
||||
bValidateEntry = false;
|
||||
}
|
||||
|
@ -461,7 +461,7 @@ static nsresult NewImageChannel(nsIChannel **aResult,
|
|||
nsresult rv;
|
||||
nsCOMPtr<nsIChannel> newChannel;
|
||||
nsCOMPtr<nsIHttpChannel> newHttpChannel;
|
||||
|
||||
|
||||
nsCOMPtr<nsIInterfaceRequestor> callbacks;
|
||||
|
||||
if (aLoadGroup) {
|
||||
|
@ -482,7 +482,7 @@ static nsresult NewImageChannel(nsIChannel **aResult,
|
|||
// canceled too.
|
||||
//
|
||||
rv = NS_NewChannel(aResult,
|
||||
aURI, // URI
|
||||
aURI, // URI
|
||||
nullptr, // Cached IOService
|
||||
nullptr, // LoadGroup
|
||||
callbacks, // Notification Callbacks
|
||||
|
@ -1139,7 +1139,7 @@ void imgLoader::CacheEntriesChanged(nsIURI *uri, int32_t sizediff /* = 0 */)
|
|||
void imgLoader::CheckCacheLimits(imgCacheTable &cache, imgCacheQueue &queue)
|
||||
{
|
||||
if (queue.GetNumElements() == 0)
|
||||
NS_ASSERTION(queue.GetSize() == 0,
|
||||
NS_ASSERTION(queue.GetSize() == 0,
|
||||
"imgLoader::CheckCacheLimits -- incorrect cache size");
|
||||
|
||||
// Remove entries from the cache until we're back under our desired size.
|
||||
|
@ -1363,7 +1363,7 @@ bool imgLoader::ValidateEntry(imgCacheEntry *aEntry,
|
|||
validateRequest = ShouldRevalidateEntry(aEntry, aLoadFlags, hasExpired);
|
||||
|
||||
PR_LOG(GetImgLog(), PR_LOG_DEBUG,
|
||||
("imgLoader::ValidateEntry validating cache entry. "
|
||||
("imgLoader::ValidateEntry validating cache entry. "
|
||||
"validateRequest = %d", validateRequest));
|
||||
}
|
||||
#if defined(PR_LOGGING)
|
||||
|
@ -1372,7 +1372,7 @@ bool imgLoader::ValidateEntry(imgCacheEntry *aEntry,
|
|||
aURI->GetSpec(spec);
|
||||
|
||||
PR_LOG(GetImgLog(), PR_LOG_DEBUG,
|
||||
("imgLoader::ValidateEntry BYPASSING cache validation for %s "
|
||||
("imgLoader::ValidateEntry BYPASSING cache validation for %s "
|
||||
"because of NULL LoadID", spec.get()));
|
||||
}
|
||||
#endif
|
||||
|
@ -1478,11 +1478,11 @@ bool imgLoader::RemoveFromCache(imgCacheEntry *entry)
|
|||
return false;
|
||||
}
|
||||
|
||||
static PLDHashOperator EnumEvictEntries(const nsACString&,
|
||||
static PLDHashOperator EnumEvictEntries(const nsACString&,
|
||||
nsRefPtr<imgCacheEntry> &aData,
|
||||
void *data)
|
||||
{
|
||||
nsTArray<nsRefPtr<imgCacheEntry> > *entries =
|
||||
nsTArray<nsRefPtr<imgCacheEntry> > *entries =
|
||||
reinterpret_cast<nsTArray<nsRefPtr<imgCacheEntry> > *>(data);
|
||||
|
||||
entries->AppendElement(aData);
|
||||
|
@ -1661,7 +1661,7 @@ nsresult imgLoader::LoadImage(nsIURI *aURI,
|
|||
|
||||
if (mCacheTracker)
|
||||
mCacheTracker->MarkUsed(entry);
|
||||
}
|
||||
}
|
||||
|
||||
entry->Touch();
|
||||
|
||||
|
@ -1765,7 +1765,7 @@ nsresult imgLoader::LoadImage(nsIURI *aURI,
|
|||
// Try to add the new request into the cache.
|
||||
PutIntoCache(aURI, entry);
|
||||
} else {
|
||||
LOG_MSG_WITH_PARAM(GetImgLog(),
|
||||
LOG_MSG_WITH_PARAM(GetImgLog(),
|
||||
"imgLoader::LoadImage |cache hit|", "request", request);
|
||||
}
|
||||
|
||||
|
@ -1902,7 +1902,7 @@ nsresult imgLoader::LoadImageWithChannel(nsIChannel *channel, imgINotificationOb
|
|||
|
||||
if (mCacheTracker)
|
||||
mCacheTracker->MarkUsed(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1997,7 +1997,7 @@ nsresult imgLoader::GetMimeTypeFromContent(const char* aContents, uint32_t aLeng
|
|||
(unsigned char)aContents[5]==0x0A &&
|
||||
(unsigned char)aContents[6]==0x1A &&
|
||||
(unsigned char)aContents[7]==0x0A))
|
||||
{
|
||||
{
|
||||
aContentType.AssignLiteral(IMAGE_PNG);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
NS_LOG_ADDREF(this, mRefCnt, "imgCacheEntry", sizeof(*this));
|
||||
return mRefCnt;
|
||||
}
|
||||
|
||||
|
||||
nsrefcnt Release()
|
||||
{
|
||||
NS_PRECONDITION(0 != mRefCnt, "dup release");
|
||||
|
@ -57,7 +57,7 @@ public:
|
|||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return mRefCnt;
|
||||
return mRefCnt;
|
||||
}
|
||||
|
||||
uint32_t GetDataSize() const
|
||||
|
@ -175,7 +175,7 @@ private: // data
|
|||
|
||||
class imgCacheQueue
|
||||
{
|
||||
public:
|
||||
public:
|
||||
imgCacheQueue();
|
||||
void Remove(imgCacheEntry *);
|
||||
void Push(imgCacheEntry *);
|
||||
|
@ -186,7 +186,7 @@ public:
|
|||
uint32_t GetSize() const;
|
||||
void UpdateSize(int32_t diff);
|
||||
uint32_t GetNumElements() const;
|
||||
typedef std::vector<nsRefPtr<imgCacheEntry> > queueContainer;
|
||||
typedef std::vector<nsRefPtr<imgCacheEntry> > queueContainer;
|
||||
typedef queueContainer::iterator iterator;
|
||||
typedef queueContainer::const_iterator const_iterator;
|
||||
|
||||
|
@ -300,11 +300,11 @@ public:
|
|||
|
||||
// The image loader maintains a hash table of all imgCacheEntries. However,
|
||||
// only some of them will be evicted from the cache: those who have no
|
||||
// imgRequestProxies watching their imgRequests.
|
||||
// imgRequestProxies watching their imgRequests.
|
||||
//
|
||||
// Once an imgRequest has no imgRequestProxies, it should notify us by
|
||||
// calling HasNoObservers(), and null out its cache entry pointer.
|
||||
//
|
||||
//
|
||||
// Upon having a proxy start observing again, it should notify us by calling
|
||||
// HasObservers(). The request's cache entry will be re-set before this
|
||||
// happens, by calling imgRequest::SetCacheEntry() when an entry with no
|
||||
|
@ -315,7 +315,7 @@ public:
|
|||
private: // methods
|
||||
|
||||
bool ValidateEntry(imgCacheEntry *aEntry, nsIURI *aKey,
|
||||
nsIURI *aInitialDocumentURI, nsIURI *aReferrerURI,
|
||||
nsIURI *aInitialDocumentURI, nsIURI *aReferrerURI,
|
||||
nsILoadGroup *aLoadGroup,
|
||||
imgINotificationObserver *aObserver, nsISupports *aCX,
|
||||
nsLoadFlags aLoadFlags, bool aCanMakeNewChannel,
|
||||
|
|
|
@ -200,7 +200,7 @@ nsresult imgRequest::RemoveProxy(imgRequestProxy *proxy, nsresult aStatus)
|
|||
NS_ABORT_IF_FALSE(mURI, "Removing last observer without key uri.");
|
||||
|
||||
mLoader->SetHasNoProxies(mURI, mCacheEntry);
|
||||
}
|
||||
}
|
||||
#if defined(PR_LOGGING)
|
||||
else {
|
||||
nsAutoCString spec;
|
||||
|
@ -842,7 +842,7 @@ imgRequest::GetInterface(const nsIID & aIID, void **aResult)
|
|||
if (!mPrevChannelSink || aIID.Equals(NS_GET_IID(nsIChannelEventSink)))
|
||||
return QueryInterface(aIID, aResult);
|
||||
|
||||
NS_ASSERTION(mPrevChannelSink != this,
|
||||
NS_ASSERTION(mPrevChannelSink != this,
|
||||
"Infinite recursion - don't keep track of channel sinks that are us!");
|
||||
return mPrevChannelSink->GetInterface(aIID, aResult);
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ private:
|
|||
inline nsIProperties *Properties() {
|
||||
return mProperties;
|
||||
}
|
||||
|
||||
|
||||
// Reset the cache entry after we've dropped our reference to it. Used by the
|
||||
// imgLoader when our cache entry is re-requested after we've dropped our
|
||||
// reference to it.
|
||||
|
|
|
@ -40,8 +40,8 @@ class Image;
|
|||
} // namespace image
|
||||
} // namespace mozilla
|
||||
|
||||
class imgRequestProxy : public imgIRequest,
|
||||
public nsISupportsPriority,
|
||||
class imgRequestProxy : public imgIRequest,
|
||||
public nsISupportsPriority,
|
||||
public nsISecurityInfoProvider,
|
||||
public nsITimedChannel
|
||||
{
|
||||
|
|
|
@ -454,7 +454,7 @@ imgStatusTracker::NotifyCurrentState(imgRequestProxy* proxy)
|
|||
|
||||
proxy->SetNotificationsDeferred(true);
|
||||
|
||||
// We don't keep track of
|
||||
// We don't keep track of
|
||||
nsCOMPtr<nsIRunnable> ev = new imgStatusNotifyRunnable(*this, proxy);
|
||||
NS_DispatchToCurrentThread(ev);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче