Bug 1128989 - part 2 - forward-declare Telemetry::ID in Decoder.h; r=seth

This change means that Decoder.h (and any files that include it) no
longer depend on Telemetry.h.  And since Telemetry.h can change rather
frequently, this change helps minimize the number of files that need to
be rebuilt when Telemetry.h does change.
This commit is contained in:
Nathan Froyd 2015-02-03 10:05:49 -05:00
parent e9cd140c50
commit e54d2ebfac
5 changed files with 16 additions and 3 deletions

View File

@ -48,6 +48,7 @@ mailing address.
#include "gfxPlatform.h" #include "gfxPlatform.h"
#include "qcms.h" #include "qcms.h"
#include <algorithm> #include <algorithm>
#include "mozilla/Telemetry.h"
namespace mozilla { namespace mozilla {
namespace image { namespace image {

View File

@ -19,6 +19,7 @@
#include "gfxPlatform.h" #include "gfxPlatform.h"
#include "mozilla/Endian.h" #include "mozilla/Endian.h"
#include "mozilla/Telemetry.h"
extern "C" { extern "C" {
#include "iccjpeg.h" #include "iccjpeg.h"

View File

@ -15,6 +15,7 @@
#include "nspr.h" #include "nspr.h"
#include "png.h" #include "png.h"
#include "RasterImage.h" #include "RasterImage.h"
#include "mozilla/Telemetry.h"
#include <algorithm> #include <algorithm>

View File

@ -15,6 +15,7 @@
#include "nsProxyRelease.h" #include "nsProxyRelease.h"
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#include "nsComponentManagerUtils.h" #include "nsComponentManagerUtils.h"
#include "mozilla/Telemetry.h"
using mozilla::gfx::IntSize; using mozilla::gfx::IntSize;
using mozilla::gfx::SurfaceFormat; using mozilla::gfx::SurfaceFormat;
@ -701,5 +702,12 @@ Decoder::NeedNewFrame(uint32_t framenum, uint32_t x_offset, uint32_t y_offset,
mNeedsNewFrame = true; mNeedsNewFrame = true;
} }
Telemetry::ID
Decoder::SpeedHistogram()
{
// Use HistogramCount as an invalid Histogram ID.
return Telemetry::HistogramCount;
}
} // namespace image } // namespace image
} // namespace mozilla } // namespace mozilla

View File

@ -13,10 +13,13 @@
#include "ImageMetadata.h" #include "ImageMetadata.h"
#include "Orientation.h" #include "Orientation.h"
#include "SourceBuffer.h" #include "SourceBuffer.h"
#include "mozilla/Telemetry.h"
namespace mozilla { namespace mozilla {
namespace Telemetry {
enum ID : uint32_t;
}
namespace image { namespace image {
class Decoder : public IResumable class Decoder : public IResumable
@ -263,8 +266,7 @@ public:
return mImageMetadata.GetSize(); return mImageMetadata.GetSize();
} }
// Use HistogramCount as an invalid Histogram ID virtual Telemetry::ID SpeedHistogram();
virtual Telemetry::ID SpeedHistogram() { return Telemetry::HistogramCount; }
ImageMetadata& GetImageMetadata() { return mImageMetadata; } ImageMetadata& GetImageMetadata() { return mImageMetadata; }