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

Unified Diff: chrome/browser/chromeos/arc/arc_wallpaper_handler.h

Issue 2175213002: arc: Do not keep track of in-flight decode requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify. 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
Index: chrome/browser/chromeos/arc/arc_wallpaper_handler.h
diff --git a/chrome/browser/chromeos/arc/arc_wallpaper_handler.h b/chrome/browser/chromeos/arc/arc_wallpaper_handler.h
index cb4b96d65158066d7d6720de953a5c58bb00b389..fee23547c5dde427a6d377adc00f69bd532884c5 100644
--- a/chrome/browser/chromeos/arc/arc_wallpaper_handler.h
+++ b/chrome/browser/chromeos/arc/arc_wallpaper_handler.h
@@ -12,6 +12,7 @@
#include <vector>
#include "base/macros.h"
+#include "chrome/browser/image_decoder.h"
#include "components/arc/set_wallpaper_delegate.h"
class SkBitmap;
@@ -19,7 +20,8 @@ class SkBitmap;
namespace arc {
// Lives on the UI thread.
-class ArcWallpaperHandler : public SetWallpaperDelegate {
+class ArcWallpaperHandler : public SetWallpaperDelegate,
+ public ImageDecoder::ImageRequest {
public:
ArcWallpaperHandler();
~ArcWallpaperHandler() override;
@@ -27,16 +29,11 @@ class ArcWallpaperHandler : public SetWallpaperDelegate {
// SetWallpaperDelegate implementation.
void SetWallpaper(const std::vector<uint8_t>& jpeg_data) override;
- private:
- class ImageRequestImpl;
-
- // Called from ImageRequestImpl on decode completion.
- void OnImageDecoded(ImageRequestImpl* request, const SkBitmap& bitmap);
- void OnDecodeImageFailed(ImageRequestImpl* request);
-
- // The set of in-flight decode requests.
- std::set<std::unique_ptr<ImageRequestImpl>> inflight_requests_;
+ // ImageDecoder::ImageRequest implementation.
+ void OnImageDecoded(const SkBitmap& bitmap) override;
+ void OnDecodeImageFailed() override;
+ private:
DISALLOW_COPY_AND_ASSIGN(ArcWallpaperHandler);
};

Powered by Google App Engine
This is Rietveld 408576698