Bug 1282275 - Return IDecodingTask objects instead of Decoder objects from most DecoderFactory functions. r=dholbert

This commit is contained in:
Seth Fowler
2016-06-26 00:09:24 -07:00
parent 2d498ea090
commit a8b8626747
4 changed files with 39 additions and 26 deletions

View File

@@ -10,6 +10,7 @@
#include "nsString.h"
#include "Decoder.h"
#include "IDecodingTask.h"
#include "nsPNGDecoder.h"
#include "nsGIFDecoder2.h"
#include "nsJPEGDecoder.h"
@@ -104,7 +105,7 @@ DecoderFactory::GetDecoder(DecoderType aType,
return decoder.forget();
}
/* static */ already_AddRefed<Decoder>
/* static */ already_AddRefed<IDecodingTask>
DecoderFactory::CreateDecoder(DecoderType aType,
RasterImage* aImage,
SourceBuffer* aSourceBuffer,
@@ -139,10 +140,11 @@ DecoderFactory::CreateDecoder(DecoderType aType,
return nullptr;
}
return decoder.forget();
RefPtr<IDecodingTask> task = new DecodingTask(WrapNotNull(decoder));
return task.forget();
}
/* static */ already_AddRefed<Decoder>
/* static */ already_AddRefed<IDecodingTask>
DecoderFactory::CreateAnimationDecoder(DecoderType aType,
RasterImage* aImage,
SourceBuffer* aSourceBuffer,
@@ -171,10 +173,11 @@ DecoderFactory::CreateAnimationDecoder(DecoderType aType,
return nullptr;
}
return decoder.forget();
RefPtr<IDecodingTask> task = new DecodingTask(WrapNotNull(decoder));
return task.forget();
}
/* static */ already_AddRefed<Decoder>
/* static */ already_AddRefed<IDecodingTask>
DecoderFactory::CreateMetadataDecoder(DecoderType aType,
RasterImage* aImage,
SourceBuffer* aSourceBuffer,
@@ -198,7 +201,8 @@ DecoderFactory::CreateMetadataDecoder(DecoderType aType,
return nullptr;
}
return decoder.forget();
RefPtr<IDecodingTask> task = new MetadataDecodingTask(WrapNotNull(decoder));
return task.forget();
}
/* static */ already_AddRefed<Decoder>