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

Unified Diff: components/suggestions/image_encoder.h

Issue 1879443002: JPEG decoding: replace ownership comments with std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fixes Created 4 years, 8 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/android/ntp/most_visited_sites.cc ('k') | components/suggestions/image_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/suggestions/image_encoder.h
diff --git a/components/suggestions/image_encoder.h b/components/suggestions/image_encoder.h
index d0aa71d5f1c571fc0b47cbbf84a8792e7d5b9452..5fec36750a4e0c96c2d9d932a1ad3789abfbce1e 100644
--- a/components/suggestions/image_encoder.h
+++ b/components/suggestions/image_encoder.h
@@ -6,17 +6,19 @@
#define COMPONENTS_SUGGESTIONS_IMAGE_ENCODER_H_
#include <stddef.h>
+
+#include <memory>
#include <vector>
class SkBitmap;
namespace suggestions {
-// From encoded bytes to SkBitmap. It's the caller's responsibility to delete
-// the bitmap.
-SkBitmap* DecodeJPEGToSkBitmap(const void* encoded_data, size_t size);
+// From encoded bytes to SkBitmap.
+std::unique_ptr<SkBitmap> DecodeJPEGToSkBitmap(const void* encoded_data,
+ size_t size);
-inline SkBitmap* DecodeJPEGToSkBitmap(
+inline std::unique_ptr<SkBitmap> DecodeJPEGToSkBitmap(
const std::vector<unsigned char>& encoded_data) {
return DecodeJPEGToSkBitmap(&encoded_data[0], encoded_data.size());
}
« no previous file with comments | « chrome/browser/android/ntp/most_visited_sites.cc ('k') | components/suggestions/image_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698