summaryrefslogtreecommitdiffstats
path: root/chrome/browser/image_decoder.cc
diff options
context:
space:
mode:
authorglevin <glevin@chromium.org>2014-09-24 07:17:21 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-24 14:17:31 +0000
commitd9d0e601c4c45ec8f2fb1d148e68458d9baa4e24 (patch)
tree04248b7b69cbcc18f042f53683ef40098b783bce /chrome/browser/image_decoder.cc
parent6e9dc50aecf078d7826fe8e4611b2c238aab3f23 (diff)
downloadchromium_src-d9d0e601c4c45ec8f2fb1d148e68458d9baa4e24.zip
chromium_src-d9d0e601c4c45ec8f2fb1d148e68458d9baa4e24.tar.gz
chromium_src-d9d0e601c4c45ec8f2fb1d148e68458d9baa4e24.tar.bz2
Handle large wallpaper decoding in utility process:
Images over 32M pixels exceed IPC message limit size. In ChromeContentUtilityClient::DecodeImage(), cut image dimensions in half to minimize quality loss and allow decoded image to be returned via IPC message. BUG=366825 TEST=ChromeContentUtilityClientTest.DecodeImageSizeLimit; Set ChromeOS wallpaper using JPGs attached to bug Review URL: https://codereview.chromium.org/482163002 Cr-Commit-Position: refs/heads/master@{#296407}
Diffstat (limited to 'chrome/browser/image_decoder.cc')
-rw-r--r--chrome/browser/image_decoder.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/image_decoder.cc b/chrome/browser/image_decoder.cc
index b49c1b9..4c96bb4 100644
--- a/chrome/browser/image_decoder.cc
+++ b/chrome/browser/image_decoder.cc
@@ -19,7 +19,8 @@ ImageDecoder::ImageDecoder(Delegate* delegate,
: delegate_(delegate),
image_data_(image_data.begin(), image_data.end()),
image_codec_(image_codec),
- task_runner_(NULL) {
+ task_runner_(NULL),
+ shrink_to_fit_(false) {
}
ImageDecoder::~ImageDecoder() {}
@@ -64,6 +65,7 @@ void ImageDecoder::DecodeImageInSandbox(
utility_process_host->Send(
new ChromeUtilityMsg_RobustJPEGDecodeImage(image_data));
} else {
- utility_process_host->Send(new ChromeUtilityMsg_DecodeImage(image_data));
+ utility_process_host->Send(
+ new ChromeUtilityMsg_DecodeImage(image_data, shrink_to_fit_));
}
}