2011-04-13  Noel Gordon  <noel.gordon@gmail.com>

        Reviewed by Kenneth Russell.

        [chromium] Fix canvas.toDataURL mimeType assertion
        https://bugs.webkit.org/show_bug.cgi?id=58425

        Following r81213, reassert expected toDataURL() mimeType, remove an unused variable.

        No new tests. Covered by existing tests.

        * platform/graphics/skia/ImageBufferSkia.cpp:
        (WebCore::ImageToDataURL):
        (WebCore::ImageBuffer::toDataURL):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 28813c9..c93430e 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2011-04-13  Noel Gordon  <noel.gordon@gmail.com>
+
+        Reviewed by Kenneth Russell.
+
+        [chromium] Fix canvas.toDataURL mimeType assertion
+        https://bugs.webkit.org/show_bug.cgi?id=58425
+
+        Following r81213, reassert expected toDataURL() mimeType, remove an unused variable.
+
+        No new tests. Covered by existing tests.
+
+        * platform/graphics/skia/ImageBufferSkia.cpp:
+        (WebCore::ImageToDataURL):
+        (WebCore::ImageBuffer::toDataURL):
+
 2011-04-12  Luiz Agostini  <luiz.agostini@openbossa.org>
 
         Reviewed by Andreas Kling.
diff --git a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index 10d8362..8dc1f86 100644
--- a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -345,6 +345,8 @@
 template <typename T>
 static String ImageToDataURL(T& source, const String& mimeType, const double* quality)
 {
+    ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
+
     Vector<unsigned char> encodedImage;
     if (mimeType == "image/jpeg") {
         int compressionQuality = JPEGImageEncoder::DefaultCompressionQuality;
@@ -366,9 +368,6 @@
 
 String ImageBuffer::toDataURL(const String& mimeType, const double* quality) const
 {
-    ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
-
-    Vector<unsigned char> encodedImage;
     SkDevice* device = context()->platformContext()->canvas()->getDevice();
     SkBitmap bitmap = device->accessBitmap(false);