Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1393)

Unified Diff: Source/platform/graphics/ImageSource.cpp

Issue 485623002: ImageSource misc cleanup (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698