Commit 4bf24e83 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Remaining changes to build all code in src.git with -Wimplicit-fallthrough.

Fixes a bug where if we received png data and then failed to decode
that, we'd try to decode it as jpeg too unintentionally, cf
https://codereview.chromium.org/2943363003/diff/120001/chrome/renderer/chrome_render_frame_observer.cc

This CL was uploaded by git cl split.

R=thestig@chromium.org

Bug: 177475
Change-Id: I1fbfc4b8b1fa009e10ace632a09619f463305cb6
Reviewed-on: https://chromium-review.googlesource.com/891899
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532872}
parent b2308cc5
...@@ -242,13 +242,12 @@ void ChromeRenderFrameObserver::RequestThumbnailForContextNode( ...@@ -242,13 +242,12 @@ void ChromeRenderFrameObserver::RequestThumbnailForContextNode(
if (gfx::PNGCodec::EncodeBGRASkBitmap( if (gfx::PNGCodec::EncodeBGRASkBitmap(
bitmap, kDiscardTransparencyForContextMenu, &data)) { bitmap, kDiscardTransparencyForContextMenu, &data)) {
thumbnail_data.swap(data); thumbnail_data.swap(data);
break;
} }
break;
case chrome::mojom::ImageFormat::JPEG: case chrome::mojom::ImageFormat::JPEG:
if (gfx::JPEGCodec::Encode(bitmap, kDefaultQuality, &data)) { if (gfx::JPEGCodec::Encode(bitmap, kDefaultQuality, &data))
thumbnail_data.swap(data); thumbnail_data.swap(data);
break; break;
}
} }
callback.Run(thumbnail_data, original_size); callback.Run(thumbnail_data, original_size);
} }
......
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