New issue
Advanced search Search tips

Issue 631327 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature



Sign in to add a comment

Avoid unnecessary copies in ImageDecoder

Project Member Reported by nya@chromium.org, Jul 26 2016

Issue description

Currently ImageDecoder (chrome/browser/image_decoder.h) unnecessarily copies the image binary data two times.

We can avoid copies at all by using C++11 move semantics.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/601d970a8b243166000aab822b779e66a0d3760e

commit 601d970a8b243166000aab822b779e66a0d3760e
Author: nya <nya@chromium.org>
Date: Tue Jul 26 18:39:21 2016

Avoid unnecessary copies in ImageDecoder.

For the deprecated API methods with const std::string&
parameter, copy is reduced from two times to once.

With the new API methods with std::vector<uint8_t>
parameter, the caller can avoid copies at all by passing
data with std::move().

Also converts ArcWallpaperHandler to use the new API
as a first user.

BUG= 631327 
TEST=browser_tests --gtest_filter='ImageDecoderBrowserTest.*'

Review-Url: https://codereview.chromium.org/2177833003
Cr-Commit-Position: refs/heads/master@{#407861}

[modify] https://crrev.com/601d970a8b243166000aab822b779e66a0d3760e/chrome/browser/chromeos/arc/arc_wallpaper_handler.cc
[modify] https://crrev.com/601d970a8b243166000aab822b779e66a0d3760e/chrome/browser/chromeos/arc/arc_wallpaper_handler.h
[modify] https://crrev.com/601d970a8b243166000aab822b779e66a0d3760e/chrome/browser/image_decoder.cc
[modify] https://crrev.com/601d970a8b243166000aab822b779e66a0d3760e/chrome/browser/image_decoder.h
[modify] https://crrev.com/601d970a8b243166000aab822b779e66a0d3760e/chrome/browser/image_decoder_browsertest.cc
[modify] https://crrev.com/601d970a8b243166000aab822b779e66a0d3760e/components/arc/set_wallpaper_delegate.h

Comment 2 by nya@chromium.org, Jul 27 2016

Status: Fixed (was: Started)

Sign in to add a comment