Chromium Code Reviews| Index: Source/platform/graphics/ImageSource.cpp |
| diff --git a/Source/platform/graphics/ImageSource.cpp b/Source/platform/graphics/ImageSource.cpp |
| index f84b3be6260a5c42c97748c56b4c74674d5ebd88..798b7dcdc0b2e0c28ceebb7821a68eb26d3cc128 100644 |
| --- a/Source/platform/graphics/ImageSource.cpp |
| +++ b/Source/platform/graphics/ImageSource.cpp |
| @@ -30,8 +30,6 @@ |
| #include "platform/graphics/DeferredImageDecoder.h" |
| #include "platform/image-decoders/ImageDecoder.h" |
| -#include "wtf/PassOwnPtr.h" |
| -#include "wtf/PassRefPtr.h" |
| namespace blink { |
| @@ -57,10 +55,8 @@ bool ImageSource::initialized() const |
| void ImageSource::setData(SharedBuffer& data, bool allDataReceived) |
| { |
| - // Make the decoder by sniffing the bytes. |
| - // This method will examine the data and instantiate an instance of the appropriate decoder plugin. |
| - // If insufficient bytes are available to determine the image type, no decoder plugin will be |
| - // made. |
| + // Create a decoder by sniffing the encoded data. If insufficient data bytes are available to |
|
tkent
2014/08/18 07:31:00
nit: I recommend to wrap code comments in 80 colum
Noel Gordon
2014/08/18 07:54:50
Acknowledged.
|
| + // determine the encoded image type, no decoder is created. |
| if (!m_decoder) |
| m_decoder = DeferredImageDecoder::create(data, m_alphaOption, m_gammaAndColorProfileOption); |
| @@ -166,9 +162,7 @@ bool ImageSource::frameIsCompleteAtIndex(size_t index) const |
| unsigned ImageSource::frameBytesAtIndex(size_t index) const |
| { |
| - if (!m_decoder) |
| - return 0; |
| - return m_decoder->frameBytesAtIndex(index); |
| + return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; |
| } |
| } // namespace blink |