From 11f16d10114d6e266b590785fcf50bca63734d62 Mon Sep 17 00:00:00 2001 From: "saintlou@chromium.org" Date: Wed, 29 Aug 2012 23:12:15 +0000 Subject: Force avatar and wallpaper decoding to use robust JPEG. The next step in an upcoming CL will bind this separate path to a different JPEG library (at a minimum on CrOS). BUG=144296 Review URL: https://chromiumcodereview.appspot.com/10892023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154001 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/image_decoder.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'chrome/browser/image_decoder.cc') diff --git a/chrome/browser/image_decoder.cc b/chrome/browser/image_decoder.cc index a345c77..1f456ee 100644 --- a/chrome/browser/image_decoder.cc +++ b/chrome/browser/image_decoder.cc @@ -14,9 +14,11 @@ using content::BrowserThread; using content::UtilityProcessHost; ImageDecoder::ImageDecoder(Delegate* delegate, - const std::string& image_data) + const std::string& image_data, + ImageCodec image_codec) : delegate_(delegate), image_data_(image_data.begin(), image_data.end()), + image_codec_(image_codec), target_thread_id_(BrowserThread::UI) { } @@ -62,5 +64,10 @@ void ImageDecoder::DecodeImageInSandbox( UtilityProcessHost* utility_process_host = UtilityProcessHost::Create( this, target_thread_id_); utility_process_host->EnableZygote(); - utility_process_host->Send(new ChromeUtilityMsg_DecodeImage(image_data)); + if (image_codec_ == ROBUST_JPEG_CODEC) { + utility_process_host->Send( + new ChromeUtilityMsg_RobustJPEGDecodeImage(image_data)); + } else { + utility_process_host->Send(new ChromeUtilityMsg_DecodeImage(image_data)); + } } -- cgit v1.1