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

Unified Diff: chrome/browser/extensions/webstore_install_helper.h

Issue 931993002: Make image_decoder a Leaky LazyInstance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a few comments Created 5 years, 9 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/extensions/bundle_installer.cc ('k') | chrome/browser/extensions/webstore_install_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/webstore_install_helper.h
diff --git a/chrome/browser/extensions/webstore_install_helper.h b/chrome/browser/extensions/webstore_install_helper.h
index 36cdd2440299d98d6934e9a2c5d51a9a49319e13..4a432b9a92c6b39d47be25f0edb195c47aca0143 100644
--- a/chrome/browser/extensions/webstore_install_helper.h
+++ b/chrome/browser/extensions/webstore_install_helper.h
@@ -9,6 +9,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "chrome/browser/image_decoder.h"
#include "content/public/browser/utility_process_host_client.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -36,7 +37,8 @@ namespace extensions {
// sending work to the utility process for parsing manifests and
// fetching/decoding icon data. Clients must implement the
// WebstoreInstallHelper::Delegate interface to receive the parsed data.
-class WebstoreInstallHelper : public content::UtilityProcessHostClient,
+class WebstoreInstallHelper : public ImageDecoder::ImageRequest,
+ public content::UtilityProcessHostClient,
public net::URLFetcherDelegate {
public:
class Delegate {
@@ -65,12 +67,10 @@ class WebstoreInstallHelper : public content::UtilityProcessHostClient,
virtual ~Delegate() {}
};
- // Only one of |icon_data| (based64-encoded icon data) or |icon_url| can be
- // specified, but it is legal for both to be empty.
+ // It is legal for |icon_url| to be empty.
WebstoreInstallHelper(Delegate* delegate,
const std::string& id,
const std::string& manifest,
- const std::string& icon_data,
const GURL& icon_url,
net::URLRequestContextGetter* context_getter);
void Start();
@@ -79,7 +79,6 @@ class WebstoreInstallHelper : public content::UtilityProcessHostClient,
~WebstoreInstallHelper() override;
void StartWorkOnIOThread();
- void StartFetchedImageDecode();
void ReportResultsIfComplete();
void ReportResultFromUIThread();
@@ -90,11 +89,13 @@ class WebstoreInstallHelper : public content::UtilityProcessHostClient,
bool OnMessageReceived(const IPC::Message& message) override;
// Message handlers.
- void OnDecodeImageSucceeded(const SkBitmap& decoded_image);
- void OnDecodeImageFailed();
void OnJSONParseSucceeded(const base::ListValue& wrapper);
void OnJSONParseFailed(const std::string& error_message);
+ // ImageDecoder::ImageRequest implementation.
+ void OnImageDecoded(const SkBitmap& decoded_image) override;
+ void OnDecodeImageFailed() override;
+
// The client who we'll report results back to.
Delegate* delegate_;
@@ -104,13 +105,9 @@ class WebstoreInstallHelper : public content::UtilityProcessHostClient,
// The manifest to parse.
std::string manifest_;
- // Only one of these should be non-empty. If |icon_base64_data_| is non-emtpy,
- // it's a base64-encoded string that needs to be parsed into an SkBitmap. If
- // |icon_url_| is non-empty, it needs to be fetched and decoded into an
+ // If |icon_url_| is non-empty, it needs to be fetched and decoded into an
// SkBitmap.
- std::string icon_base64_data_;
GURL icon_url_;
- std::vector<unsigned char> fetched_icon_data_;
// For fetching the icon, if needed.
scoped_ptr<net::URLFetcher> url_fetcher_;
« no previous file with comments | « chrome/browser/extensions/bundle_installer.cc ('k') | chrome/browser/extensions/webstore_install_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698