| Index: chrome/browser/chromeos/extensions/wallpaper_function_base.cc
|
| diff --git a/chrome/browser/chromeos/extensions/wallpaper_function_base.cc b/chrome/browser/chromeos/extensions/wallpaper_function_base.cc
|
| index 3adda8e587dfbcd34d9575b99900078dda620506..372c2b45239f951506edece9f9666d34ae6ed639 100644
|
| --- a/chrome/browser/chromeos/extensions/wallpaper_function_base.cc
|
| +++ b/chrome/browser/chromeos/extensions/wallpaper_function_base.cc
|
| @@ -55,21 +55,18 @@ class WallpaperFunctionBase::UnsafeWallpaperDecoder
|
| // unsafe image decoder here. Before user login, a robust jpeg decoder will
|
| // be used.
|
| CHECK(chromeos::LoginState::Get()->IsUserLoggedIn());
|
| - unsafe_image_decoder_ = new ImageDecoder(this, image_data,
|
| - ImageDecoder::DEFAULT_CODEC);
|
| - unsafe_image_decoder_->set_shrink_to_fit(true);
|
| -
|
| scoped_refptr<base::MessageLoopProxy> task_runner =
|
| BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI);
|
| - unsafe_image_decoder_->Start(task_runner);
|
| + std::string image_data_str(image_data.begin(), image_data.end());
|
| + ImageDecoder::GetInstance()->Start(
|
| + this, image_data_str, ImageDecoder::DEFAULT_CODEC, task_runner, true);
|
| }
|
|
|
| void Cancel() {
|
| cancel_flag_.Set();
|
| }
|
|
|
| - void OnImageDecoded(const ImageDecoder* decoder,
|
| - const SkBitmap& decoded_image) override {
|
| + void OnImageDecoded(const SkBitmap& decoded_image) override {
|
| // Make the SkBitmap immutable as we won't modify it. This is important
|
| // because otherwise it gets duplicated during painting, wasting memory.
|
| SkBitmap immutable(decoded_image);
|
| @@ -85,7 +82,7 @@ class WallpaperFunctionBase::UnsafeWallpaperDecoder
|
| delete this;
|
| }
|
|
|
| - void OnDecodeImageFailed(const ImageDecoder* decoder) override {
|
| + void OnDecodeImageFailed() override {
|
| function_->OnFailure(
|
| l10n_util::GetStringUTF8(IDS_WALLPAPER_MANAGER_INVALID_WALLPAPER));
|
| delete this;
|
| @@ -93,7 +90,6 @@ class WallpaperFunctionBase::UnsafeWallpaperDecoder
|
|
|
| private:
|
| scoped_refptr<WallpaperFunctionBase> function_;
|
| - scoped_refptr<ImageDecoder> unsafe_image_decoder_;
|
| base::CancellationFlag cancel_flag_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(UnsafeWallpaperDecoder);
|
|
|