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

Unified Diff: chrome/browser/image_decoder.h

Issue 2177833003: Avoid unnecessary copies in ImageDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change ArcWallpaperHandler to use new API. Created 4 years, 5 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/chromeos/arc/arc_wallpaper_handler.cc ('k') | chrome/browser/image_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/image_decoder.h
diff --git a/chrome/browser/image_decoder.h b/chrome/browser/image_decoder.h
index 1808eac85003d91af0413fc51a28f35168fb539c..2c8160d6f3989a7e6133937035c3a6d1e9f6ee8b 100644
--- a/chrome/browser/image_decoder.h
+++ b/chrome/browser/image_decoder.h
@@ -79,11 +79,19 @@ class ImageDecoder : public content::UtilityProcessHostClient {
// Calls StartWithOptions() with ImageCodec::DEFAULT_CODEC and
// shrink_to_fit = false.
static void Start(ImageRequest* image_request,
+ std::vector<uint8_t> image_data);
+ // Deprecated. Use std::vector<uint8_t> version to avoid an extra copy.
+ static void Start(ImageRequest* image_request,
const std::string& image_data);
// Starts asynchronous image decoding. Once finished, the callback will be
// posted back to image_request's |task_runner_|.
static void StartWithOptions(ImageRequest* image_request,
+ std::vector<uint8_t> image_data,
+ ImageCodec image_codec,
+ bool shrink_to_fit);
+ // Deprecated. Use std::vector<uint8_t> version to avoid an extra copy.
+ static void StartWithOptions(ImageRequest* image_request,
const std::string& image_data,
ImageCodec image_codec,
bool shrink_to_fit);
@@ -105,12 +113,12 @@ class ImageDecoder : public content::UtilityProcessHostClient {
// batch mode if necessary. If the utility process fails to start,
// an OnDecodeImageFailed task is posted to image_request's |task_runner_|.
void DecodeImageInSandbox(int request_id,
- const std::vector<unsigned char>& image_data,
+ std::vector<uint8_t> image_data,
ImageCodec image_codec,
bool shrink_to_fit);
void StartWithOptionsImpl(ImageRequest* image_request,
- const std::string& image_data,
+ std::vector<uint8_t> image_data,
ImageCodec image_codec,
bool shrink_to_fit);
void CancelImpl(ImageRequest* image_request);
« no previous file with comments | « chrome/browser/chromeos/arc/arc_wallpaper_handler.cc ('k') | chrome/browser/image_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698