Index: chrome/browser/apps/drive/drive_app_converter.cc |
diff --git a/chrome/browser/apps/drive/drive_app_converter.cc b/chrome/browser/apps/drive/drive_app_converter.cc |
index daaa24d3ee63aadf8caedcb54523dc4243d84c76..6a3666b63bcea22e7eaf3bd3b674dfca79f02289 100644 |
--- a/chrome/browser/apps/drive/drive_app_converter.cc |
+++ b/chrome/browser/apps/drive/drive_app_converter.cc |
@@ -41,8 +41,6 @@ class DriveAppConverter::IconFetcher : public net::URLFetcherDelegate, |
icon_url_(icon_url), |
expected_size_(expected_size) {} |
~IconFetcher() override { |
- if (image_decoder_.get()) |
- image_decoder_->set_delegate(NULL); |
} |
void Start() { |
@@ -71,30 +69,25 @@ class DriveAppConverter::IconFetcher : public net::URLFetcherDelegate, |
std::string unsafe_icon_data; |
fetcher->GetResponseAsString(&unsafe_icon_data); |
- image_decoder_ = |
- new ImageDecoder(this, unsafe_icon_data, ImageDecoder::DEFAULT_CODEC); |
- image_decoder_->Start( |
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)); |
+ ImageDecoder::GetInstance()->Start( |
+ this, unsafe_icon_data, ImageDecoder::DEFAULT_CODEC, |
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), false); |
} |
// ImageDecoder::Delegate overrides: |
- void OnImageDecoded(const ImageDecoder* decoder, |
- const SkBitmap& decoded_image) override { |
+ void OnImageDecoded(const SkBitmap& decoded_image) override { |
if (decoded_image.width() == expected_size_) |
icon_ = decoded_image; |
converter_->OnIconFetchComplete(this); |
} |
- void OnDecodeImageFailed(const ImageDecoder* decoder) override { |
- converter_->OnIconFetchComplete(this); |
- } |
+ void OnDecodeImageFailed() override { converter_->OnIconFetchComplete(this); } |
DriveAppConverter* converter_; |
const GURL icon_url_; |
const int expected_size_; |
scoped_ptr<net::URLFetcher> fetcher_; |
- scoped_refptr<ImageDecoder> image_decoder_; |
SkBitmap icon_; |
DISALLOW_COPY_AND_ASSIGN(IconFetcher); |