Diff
Modified: trunk/Source/WebCore/ChangeLog (202676 => 202677)
--- trunk/Source/WebCore/ChangeLog 2016-06-30 08:14:35 UTC (rev 202676)
+++ trunk/Source/WebCore/ChangeLog 2016-06-30 13:37:25 UTC (rev 202677)
@@ -1,3 +1,19 @@
+2016-06-30 Carlos Garcia Campos <cgar...@igalia.com>
+
+ [image-decoders] Use final and override in ImageDecoder subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=159291
+
+ Reviewed by Antonio Gomes.
+
+ * platform/image-decoders/bmp/BMPImageDecoder.h:
+ * platform/image-decoders/gif/GIFImageDecoder.h:
+ * platform/image-decoders/ico/ICOImageDecoder.cpp:
+ (WebCore::ICOImageDecoder::frameSizeAtIndex):
+ * platform/image-decoders/ico/ICOImageDecoder.h:
+ * platform/image-decoders/jpeg/JPEGImageDecoder.h:
+ * platform/image-decoders/png/PNGImageDecoder.h:
+ * platform/image-decoders/webp/WEBPImageDecoder.h:
+
2016-06-30 Gyuyoung Kim <gyuyoung....@webkit.org>
Purge PassRefPtr in Modules/webdatabase
Modified: trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h (202676 => 202677)
--- trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h 2016-06-30 08:14:35 UTC (rev 202676)
+++ trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h 2016-06-30 13:37:25 UTC (rev 202677)
@@ -36,19 +36,19 @@
namespace WebCore {
// This class decodes the BMP image format.
- class BMPImageDecoder : public ImageDecoder {
+ class BMPImageDecoder final : public ImageDecoder {
public:
BMPImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
// ImageDecoder
- virtual String filenameExtension() const { return "bmp"; }
- virtual void setData(SharedBuffer&, bool allDataReceived);
- virtual bool isSizeAvailable();
- virtual ImageFrame* frameBufferAtIndex(size_t index);
+ String filenameExtension() const override { return "bmp"; }
+ void setData(SharedBuffer&, bool allDataReceived) override;
+ bool isSizeAvailable() override;
+ ImageFrame* frameBufferAtIndex(size_t index) override;
// CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
// accessing deleted memory, especially when calling this from inside
// BMPImageReader!
- virtual bool setFailed();
+ bool setFailed() override;
private:
inline uint32_t readUint32(int offset) const
Modified: trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h (202676 => 202677)
--- trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h 2016-06-30 08:14:35 UTC (rev 202676)
+++ trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h 2016-06-30 13:37:25 UTC (rev 202677)
@@ -33,7 +33,7 @@
namespace WebCore {
// This class decodes the GIF image format.
- class GIFImageDecoder : public ImageDecoder {
+ class GIFImageDecoder final : public ImageDecoder {
public:
GIFImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
virtual ~GIFImageDecoder();
@@ -41,18 +41,18 @@
enum GIFQuery { GIFFullQuery, GIFSizeQuery, GIFFrameCountQuery };
// ImageDecoder
- virtual String filenameExtension() const { return "gif"; }
- virtual void setData(SharedBuffer& data, bool allDataReceived);
- virtual bool isSizeAvailable();
- virtual bool setSize(unsigned width, unsigned height);
- virtual size_t frameCount();
- virtual int repetitionCount() const;
- virtual ImageFrame* frameBufferAtIndex(size_t index);
+ String filenameExtension() const override { return "gif"; }
+ void setData(SharedBuffer& data, bool allDataReceived) override;
+ bool isSizeAvailable() override;
+ bool setSize(unsigned width, unsigned height) override;
+ size_t frameCount() override;
+ int repetitionCount() const override;
+ ImageFrame* frameBufferAtIndex(size_t index) override;
// CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
// accessing deleted memory, especially when calling this from inside
// GIFImageReader!
- virtual bool setFailed();
- virtual void clearFrameBufferCache(size_t clearBeforeFrame);
+ bool setFailed() override;
+ void clearFrameBufferCache(size_t clearBeforeFrame) override;
// Callbacks from the GIF reader.
bool haveDecodedRow(unsigned frameIndex, const Vector<unsigned char>& rowBuffer, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTransparentPixels);
Modified: trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp (202676 => 202677)
--- trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp 2016-06-30 08:14:35 UTC (rev 202676)
+++ trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp 2016-06-30 13:37:25 UTC (rev 202677)
@@ -83,7 +83,7 @@
return m_frameSize.isEmpty() ? ImageDecoder::size() : m_frameSize;
}
-IntSize ICOImageDecoder::frameSizeAtIndex(size_t index) const
+IntSize ICOImageDecoder::frameSizeAtIndex(size_t index, SubsamplingLevel) const
{
return (index && (index < m_dirEntries.size())) ? m_dirEntries[index].m_size : size();
}
Modified: trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h (202676 => 202677)
--- trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h 2016-06-30 08:14:35 UTC (rev 202676)
+++ trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h 2016-06-30 13:37:25 UTC (rev 202677)
@@ -38,25 +38,25 @@
class PNGImageDecoder;
// This class decodes the ICO and CUR image formats.
- class ICOImageDecoder : public ImageDecoder {
+ class ICOImageDecoder final : public ImageDecoder {
public:
ICOImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
virtual ~ICOImageDecoder();
// ImageDecoder
- virtual String filenameExtension() const { return "ico"; }
- virtual void setData(SharedBuffer&, bool allDataReceived);
- virtual bool isSizeAvailable();
- virtual IntSize size() const;
- virtual IntSize frameSizeAtIndex(size_t) const;
- virtual bool setSize(unsigned width, unsigned height);
- virtual size_t frameCount();
- virtual ImageFrame* frameBufferAtIndex(size_t);
+ String filenameExtension() const override { return "ico"; }
+ void setData(SharedBuffer&, bool allDataReceived) override;
+ bool isSizeAvailable() override;
+ IntSize size() const override;
+ IntSize frameSizeAtIndex(size_t, SubsamplingLevel) const override;
+ bool setSize(unsigned width, unsigned height) override;
+ size_t frameCount() override;
+ ImageFrame* frameBufferAtIndex(size_t) override;
// CAUTION: setFailed() deletes all readers and decoders. Be careful to
// avoid accessing deleted memory, especially when calling this from
// inside BMPImageReader!
- virtual bool setFailed();
- virtual Optional<IntPoint> hotSpot() const;
+ bool setFailed() override;
+ Optional<IntPoint> hotSpot() const override;
private:
enum ImageType {
Modified: trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h (202676 => 202677)
--- trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h 2016-06-30 08:14:35 UTC (rev 202676)
+++ trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h 2016-06-30 13:37:25 UTC (rev 202677)
@@ -42,20 +42,20 @@
class JPEGImageReader;
// This class decodes the JPEG image format.
- class JPEGImageDecoder : public ImageDecoder {
+ class JPEGImageDecoder final : public ImageDecoder {
public:
JPEGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
virtual ~JPEGImageDecoder();
// ImageDecoder
- virtual String filenameExtension() const { return "jpg"; }
- virtual bool isSizeAvailable();
- virtual bool setSize(unsigned width, unsigned height);
- virtual ImageFrame* frameBufferAtIndex(size_t index);
+ String filenameExtension() const override { return "jpg"; }
+ bool isSizeAvailable() override;
+ bool setSize(unsigned width, unsigned height) override;
+ ImageFrame* frameBufferAtIndex(size_t index) override;
// CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
// accessing deleted memory, especially when calling this from inside
// JPEGImageReader!
- virtual bool setFailed();
+ bool setFailed() override;
bool willDownSample()
{
Modified: trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h (202676 => 202677)
--- trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h 2016-06-30 08:14:35 UTC (rev 202676)
+++ trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h 2016-06-30 13:37:25 UTC (rev 202677)
@@ -36,7 +36,7 @@
class PNGImageReader;
// This class decodes the PNG image format.
- class PNGImageDecoder : public ImageDecoder {
+ class PNGImageDecoder final : public ImageDecoder {
public:
PNGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
virtual ~PNGImageDecoder();
Modified: trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h (202676 => 202677)
--- trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h 2016-06-30 08:14:35 UTC (rev 202676)
+++ trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h 2016-06-30 13:37:25 UTC (rev 202677)
@@ -37,14 +37,14 @@
namespace WebCore {
-class WEBPImageDecoder : public ImageDecoder {
+class WEBPImageDecoder final : public ImageDecoder {
public:
WEBPImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
virtual ~WEBPImageDecoder();
- virtual String filenameExtension() const { return "webp"; }
- virtual bool isSizeAvailable();
- virtual ImageFrame* frameBufferAtIndex(size_t index);
+ String filenameExtension() const override { return "webp"; }
+ bool isSizeAvailable() override;
+ ImageFrame* frameBufferAtIndex(size_t index) override;
private:
bool decode(bool onlySize);