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

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 569623002: Switch ChromeOS Chromium login to use IJG libjpeg (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix copyright and add unit test assertions Created 5 years, 7 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/utility/chrome_content_utility_client.h ('k') | ui/gfx/BUILD.gn » ('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 1c79cdf4e55c426c0faf53aad0c6919618e1a411..f47309d6995f82d09e28c5bc3434127f4ceb1ae1 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -24,9 +24,12 @@
#include "skia/ext/image_operations.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/zlib/google/zip.h"
-#include "ui/gfx/codec/jpeg_codec.h"
#include "ui/gfx/geometry/size.h"
+#if defined(OS_CHROMEOS)
+#include "ui/gfx/chromeos/codec/jpeg_codec_robust_slow.h"
+#endif
+
#if !defined(OS_ANDROID)
#include "chrome/utility/profile_import_handler.h"
#include "net/proxy/mojo_proxy_resolver_factory_impl.h"
@@ -148,8 +151,10 @@ bool ChromeContentUtilityClient::OnMessageReceived(
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ChromeContentUtilityClient, message)
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_DecodeImage, OnDecodeImage)
+#if defined(OS_CHROMEOS)
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_RobustJPEGDecodeImage,
OnRobustJPEGDecodeImage)
+#endif // defined(OS_CHROMEOS)
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_ParseJSON, OnParseJSON)
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_PatchFileBsdiff,
OnPatchFileBsdiff)
@@ -307,13 +312,13 @@ void ChromeContentUtilityClient::OnDetectSeccompSupport() {
}
#endif // defined(OS_ANDROID) && defined(USE_SECCOMP_BPF)
+#if defined(OS_CHROMEOS)
void ChromeContentUtilityClient::OnRobustJPEGDecodeImage(
const std::vector<unsigned char>& encoded_data,
int request_id) {
// Our robust jpeg decoding is using IJG libjpeg.
- if (gfx::JPEGCodec::JpegLibraryVariant() == gfx::JPEGCodec::IJG_LIBJPEG &&
- !encoded_data.empty()) {
- scoped_ptr<SkBitmap> decoded_image(gfx::JPEGCodec::Decode(
+ if (!encoded_data.empty()) {
+ scoped_ptr<SkBitmap> decoded_image(gfx::JPEGCodecRobustSlow::Decode(
&encoded_data[0], encoded_data.size()));
if (!decoded_image.get() || decoded_image->empty()) {
Send(new ChromeUtilityHostMsg_DecodeImage_Failed(request_id));
@@ -326,6 +331,7 @@ void ChromeContentUtilityClient::OnRobustJPEGDecodeImage(
}
ReleaseProcessIfNeeded();
}
+#endif // defined(OS_CHROMEOS)
void ChromeContentUtilityClient::OnParseJSON(const std::string& json) {
int error_code;
« no previous file with comments | « chrome/utility/chrome_content_utility_client.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698