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

Unified Diff: chrome/browser/image_decoder.cc

Issue 2014013002: Add SkBitmap StructTraits for skia::mojo::Bitmap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. Created 4 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/browser/DEPS ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/image_decoder.cc
diff --git a/chrome/browser/image_decoder.cc b/chrome/browser/image_decoder.cc
index e1de584848d053854f9939c1e11d7e2fe4490330..adb15c3fcb7784a4c870da9164d4d9e42fd94d9d 100644
--- a/chrome/browser/image_decoder.cc
+++ b/chrome/browser/image_decoder.cc
@@ -13,7 +13,6 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/utility_process_host.h"
#include "content/public/common/service_registry.h"
-#include "skia/public/type_converters.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
@@ -32,16 +31,13 @@ const int kBatchModeTimeoutSeconds = 5;
void OnDecodeImageDone(
base::Callback<void(int)> fail_callback,
base::Callback<void(const SkBitmap&, int)> success_callback,
- int request_id, skia::mojom::BitmapPtr image) {
+ int request_id,
+ const SkBitmap& image) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- if (image) {
- SkBitmap bitmap = image.To<SkBitmap>();
- if (!bitmap.empty()) {
- success_callback.Run(bitmap, request_id);
- return;
- }
- }
- fail_callback.Run(request_id);
+ if (!image.isNull() && !image.empty())
+ success_callback.Run(image, request_id);
+ else
+ fail_callback.Run(request_id);
}
} // namespace
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698