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

@@ -47,6 +47,9 @@ public:
/// DecodePool. Subclasses can override this if they need different behavior.
void Resume() override;
/// @return a non-null weak pointer to the Decoder associated with this task.
virtual NotNull<Decoder*> GetDecoder() const = 0;
// Notify the Image associated with a Decoder of its progress, sending a
// runnable to the main thread if necessary.
// XXX(seth): This is a hack that will be removed soon.
@@ -74,6 +77,8 @@ public:
// don't block layout or page load.
TaskPriority Priority() const override { return TaskPriority::eLow; }
NotNull<Decoder*> GetDecoder() const override { return mDecoder; }
private:
virtual ~DecodingTask() { }
@@ -102,6 +107,8 @@ public:
// page load.
TaskPriority Priority() const override { return TaskPriority::eHigh; }
NotNull<Decoder*> GetDecoder() const override { return mDecoder; }
private:
virtual ~MetadataDecodingTask() { }
@@ -130,6 +137,8 @@ public:
// matter what, we don't want to resume by posting a task to the DecodePool.
void Resume() override { }
NotNull<Decoder*> GetDecoder() const override { return mDecoder; }
private:
virtual ~AnonymousDecodingTask() { }