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

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 10912019: Enable robust decoding of custom wallpaper and allow custom wallpaper on login page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check conflict. Created 8 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 | « chrome/browser/chromeos/login/wallpaper_manager.cc ('k') | ui/gfx/codec/jpeg_codec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/chrome_content_utility_client.cc
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc
index f28771c4880c88697fcc48191c6d5bc88638c0fb..736dd3b529949900fc4c0e9c19b3c170782be2fb 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -362,12 +362,17 @@ bool ChromeContentUtilityClient::RenderPDFToWinMetafile(
void ChromeContentUtilityClient::OnRobustJPEGDecodeImage(
const std::vector<unsigned char>& encoded_data) {
- scoped_ptr<SkBitmap> decoded_image(gfx::JPEGCodec::Decode(
- &encoded_data[0], encoded_data.size()));
- if (decoded_image->empty()) {
- Send(new ChromeUtilityHostMsg_DecodeImage_Failed());
+ // Our robust jpeg decoding is using IJG libjpeg.
+ if (gfx::JPEGCodec::JpegLibraryVariant() == gfx::JPEGCodec::IJG_LIBJPEG) {
+ scoped_ptr<SkBitmap> decoded_image(gfx::JPEGCodec::Decode(
+ &encoded_data[0], encoded_data.size()));
+ if (!decoded_image.get() || decoded_image->empty()) {
+ Send(new ChromeUtilityHostMsg_DecodeImage_Failed());
+ } else {
+ Send(new ChromeUtilityHostMsg_DecodeImage_Succeeded(*decoded_image));
+ }
} else {
- Send(new ChromeUtilityHostMsg_DecodeImage_Succeeded(*decoded_image));
+ Send(new ChromeUtilityHostMsg_DecodeImage_Failed());
}
content::UtilityThread::Get()->ReleaseProcessIfNeeded();
}
« no previous file with comments | « chrome/browser/chromeos/login/wallpaper_manager.cc ('k') | ui/gfx/codec/jpeg_codec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698