Issue #21 - Remove Telemetry plumbing and fix build.

Note this won't give working applications. Requires FE changes and
additional js module changes (next part).
This commit is contained in:
Moonchild 2021-10-29 11:02:27 +00:00 • committed by roytam1
commit 8d800b1cb0
205 changed files with 45 additions and 40519 deletions

View file

@ -13,7 +13,6 @@
#include "nsProxyRelease.h"
#include "nsServiceManagerUtils.h"
#include "nsComponentManagerUtils.h"
#include "mozilla/Telemetry.h"
using mozilla::gfx::IntSize;
using mozilla::gfx::SurfaceFormat;
@ -21,29 +20,6 @@ using mozilla::gfx::SurfaceFormat;
namespace mozilla {
namespace image {
class MOZ_STACK_CLASS AutoRecordDecoderTelemetry final
{
public:
explicit AutoRecordDecoderTelemetry(Decoder* aDecoder)
: mDecoder(aDecoder)
{
MOZ_ASSERT(mDecoder);
// Begin recording telemetry data.
mStartTime = TimeStamp::Now();
}
~AutoRecordDecoderTelemetry()
{
// Finish telemetry.
mDecoder->mDecodeTime += (TimeStamp::Now() - mStartTime);
}
private:
Decoder* mDecoder;
TimeStamp mStartTime;
};
Decoder::Decoder(RasterImage* aImage)
: mImageData(nullptr)
, mImageDataLength(0)
@ -124,7 +100,6 @@ Decoder::Decode(IResumable* aOnResume /* = nullptr */)
LexerResult lexerResult(TerminalState::FAILURE);
{
PROFILER_LABEL("ImageDecoder", "Decode", js::ProfileEntry::Category::GRAPHICS);
AutoRecordDecoderTelemetry telemetry(this);
lexerResult = DoDecode(*mIterator, aOnResume);
};
@ -267,16 +242,6 @@ Decoder::FinalStatus() const
ShouldReportError());
}
DecoderTelemetry
Decoder::Telemetry() const
{
MOZ_ASSERT(mIterator);
return DecoderTelemetry(SpeedHistogram(),
mIterator->ByteCount(),
mIterator->ChunkCount(),
mDecodeTime);
}
nsresult
Decoder::AllocateFrame(const gfx::IntSize& aOutputSize,
const gfx::IntRect& aFrameRect,

View file

@ -66,7 +66,6 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
// Capture the decoder's state.
DecoderFinalStatus finalStatus = aDecoder->FinalStatus();
ImageMetadata metadata = aDecoder->GetImageMetadata();
DecoderTelemetry telemetry = aDecoder->Telemetry();
Progress progress = aDecoder->TakeProgress();
IntRect invalidRect = aDecoder->TakeInvalidRect();
Maybe<uint32_t> frameCount = aDecoder->TakeCompleteFrameCount();
@ -75,7 +74,7 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
// Synchronously notify if we can.
if (NS_IsMainThread() && !(decoderFlags & DecoderFlags::ASYNC_NOTIFY)) {
aImage->NotifyDecodeComplete(finalStatus, metadata, telemetry, progress,
aImage->NotifyDecodeComplete(finalStatus, metadata, progress,
invalidRect, frameCount, decoderFlags,
surfaceFlags);
return;
@ -84,7 +83,7 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
// We're forced to notify asynchronously.
NotNull<RefPtr<RasterImage>> image = aImage;
NS_DispatchToMainThread(NS_NewRunnableFunction([=]() -> void {
image->NotifyDecodeComplete(finalStatus, metadata, telemetry, progress,
image->NotifyDecodeComplete(finalStatus, metadata, progress,
invalidRect, frameCount, decoderFlags,
surfaceFlags);
}));

View file

@ -40,7 +40,6 @@
#include "mozilla/Services.h"
#include <stdint.h>
#include "mozilla/TimeStamp.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Tuple.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/gfx/Scale.h"
@ -1558,7 +1557,6 @@ RasterImage::NotifyProgress(Progress aProgress,
void
RasterImage::NotifyDecodeComplete(const DecoderFinalStatus& aStatus,
const ImageMetadata& aMetadata,
const DecoderTelemetry& aTelemetry,
Progress aProgress,
const IntRect& aInvalidRect,
const Maybe<uint32_t>& aFrameCount,

View file

@ -224,7 +224,6 @@ public:
*/
void NotifyDecodeComplete(const DecoderFinalStatus& aStatus,
const ImageMetadata& aMetadata,
const DecoderTelemetry& aTelemetry,
Progress aProgress,
const gfx::IntRect& aInvalidRect,
const Maybe<uint32_t>& aFrameCount,

View file

@ -52,7 +52,6 @@ mailing address.
#include "gfxPlatform.h"
#include "qcms.h"
#include <algorithm>
#include "mozilla/Telemetry.h"
using namespace mozilla::gfx;
@ -1088,11 +1087,5 @@ nsGIFDecoder2::SkipSubBlocks(const char* aData)
nextSubBlockLength);
}
Maybe<Telemetry::ID>
nsGIFDecoder2::SpeedHistogram() const
{
return Some(Telemetry::IMAGE_DECODE_SPEED_GIF);
}
} // namespace image
} // namespace mozilla

View file

@ -29,8 +29,6 @@ protected:
IResumable* aOnResume) override;
nsresult FinishInternal() override;
Maybe<Telemetry::ID> SpeedHistogram() const override;
private:
friend class DecoderFactory;

View file

@ -24,7 +24,6 @@
#include "gfxPlatform.h"
#include "mozilla/EndianUtils.h"
#include "mozilla/Telemetry.h"
extern "C" {
#include "iccjpeg.h"
@ -123,12 +122,6 @@ nsJPEGDecoder::~nsJPEGDecoder()
this));
}
Maybe<Telemetry::ID>
nsJPEGDecoder::SpeedHistogram() const
{
return Some(Telemetry::IMAGE_DECODE_SPEED_JPEG);
}
nsresult
nsJPEGDecoder::InitInternal()
{

View file

@ -65,8 +65,6 @@ protected:
IResumable* aOnResume) override;
nsresult FinishInternal() override;
Maybe<Telemetry::ID> SpeedHistogram() const override;
protected:
Orientation ReadOrientationFromEXIF();
void OutputScanlines(bool* suspend);

View file

@ -22,7 +22,6 @@
#include "RasterImage.h"
#include "SurfacePipeFactory.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/Telemetry.h"
using namespace mozilla::gfx;
@ -1087,12 +1086,6 @@ nsPNGDecoder::warning_callback(png_structp png_ptr, png_const_charp warning_msg)
MOZ_LOG(sPNGLog, LogLevel::Warning, ("libpng warning: %s\n", warning_msg));
}
Maybe<Telemetry::ID>
nsPNGDecoder::SpeedHistogram() const
{
return Some(Telemetry::IMAGE_DECODE_SPEED_PNG);
}
bool
nsPNGDecoder::IsValidICO() const
{

View file

@ -30,8 +30,6 @@ protected:
LexerResult DoDecode(SourceBufferIterator& aIterator,
IResumable* aOnResume) override;
Maybe<Telemetry::ID> SpeedHistogram() const override;
private:
friend class DecoderFactory;