Revert "Issue #21 - Remove use counters telemetry"

This reverts commit 8ca9db6b65.
This commit is contained in:
roytam1 2022-04-27 16:25:00 +08:00
commit 92a1cc3139
45 changed files with 1128 additions and 36 deletions

View file

@ -337,5 +337,11 @@ DynamicImage::Unwrap()
return self.forget();
}
void
DynamicImage::PropagateUseCounters(nsIDocument*)
{
// No use counters.
}
} // namespace image
} // namespace mozilla

View file

@ -291,6 +291,12 @@ ImageWrapper::SetAnimationStartTime(const TimeStamp& aTime)
mInnerImage->SetAnimationStartTime(aTime);
}
void
ImageWrapper::PropagateUseCounters(nsIDocument* aParentDocument)
{
mInnerImage->PropagateUseCounters(aParentDocument);
}
nsIntSize
ImageWrapper::OptimalImageSizeForDest(const gfxSize& aDest,
uint32_t aWhichFrame,

View file

@ -1663,6 +1663,12 @@ RasterImage::Unwrap()
return self.forget();
}
void
RasterImage::PropagateUseCounters(nsIDocument*)
{
// No use counters.
}
IntSize
RasterImage::OptimalImageSizeForDest(const gfxSize& aDest, uint32_t aWhichFrame,
SamplingFilter aSamplingFilter, uint32_t aFlags)

View file

@ -34,6 +34,7 @@
#include "SVGDocumentWrapper.h"
#include "nsIDOMEventListener.h"
#include "SurfaceCache.h"
#include "nsDocument.h"
// undef the GetCurrentTime macro defined in WinBase.h from the MS Platform SDK
#undef GetCurrentTime
@ -1327,6 +1328,15 @@ VectorImage::InvalidateObserversOnNextRefreshDriverTick()
}
}
void
VectorImage::PropagateUseCounters(nsIDocument* aParentDocument)
{
nsIDocument* doc = mSVGDocumentWrapper->GetDocument();
if (doc) {
doc->PropagateUseCounters(aParentDocument);
}
}
nsIntSize
VectorImage::OptimalImageSizeForDest(const gfxSize& aDest,
uint32_t aWhichFrame,

View file

@ -19,6 +19,8 @@
#include "nsSize.h"
#include "limits.h"
class nsIDocument;
namespace mozilla {
namespace layers {
class LayerManager;
@ -65,6 +67,7 @@ native Orientation(mozilla::image::Orientation);
native TempRefSourceSurface(already_AddRefed<mozilla::gfx::SourceSurface>);
native TempRefImgIContainer(already_AddRefed<imgIContainer>);
native nsIntSizeByVal(nsIntSize);
[ptr] native nsIDocument(nsIDocument);
/**
@ -74,7 +77,7 @@ native nsIntSizeByVal(nsIntSize);
*
* Internally, imgIContainer also manages animation of images.
*/
[scriptable, builtinclass, uuid(7ba72242-28da-4c5f-b53f-54da8874775e)]
[scriptable, builtinclass, uuid(a8dbee24-ff86-4755-b40e-51175caf31af)]
interface imgIContainer : nsISupports
{
/**
@ -539,4 +542,10 @@ interface imgIContainer : nsISupports
* Removes any ImageWrappers and returns the unwrapped base image.
*/
[notxpcom, nostdcall] TempRefImgIContainer unwrap();
/*
* Propagate the use counters (if any) from this container to the passed in
* document.
*/
[noscript, notxpcom] void propagateUseCounters(in nsIDocument aDocument);
};