Commit d19406cb authored by noel@chromium.org's avatar noel@chromium.org

ImageSource misc cleanup

Remove unused includes, simplify and clarify a comment, format the
frameBytesAtIndex() code like the rest of the code in this file.

BUG=None

Review URL: https://codereview.chromium.org/485623002

git-svn-id: svn://svn.chromium.org/blink/trunk@180434 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent eba1945a
......@@ -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
// 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment