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

Unified Diff: components/favicon/core/favicon_handler.h

Issue 2738063004: Remove DownloadRequest registry from FaviconHandler (Closed)
Patch Set: Rebased. Created 3 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 | « no previous file | components/favicon/core/favicon_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/favicon/core/favicon_handler.h
diff --git a/components/favicon/core/favicon_handler.h b/components/favicon/core/favicon_handler.h
index f3d9d4b662c5d9c6f034cacffc7f5a8cfd67d9db..5bab69c48bc15ea8087996c3ed5e8024fa32d931 100644
--- a/components/favicon/core/favicon_handler.h
+++ b/components/favicon/core/favicon_handler.h
@@ -7,13 +7,12 @@
#include <stddef.h>
-#include <map>
#include <vector>
#include "base/callback_forward.h"
+#include "base/cancelable_callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
#include "base/task/cancelable_task_tracker.h"
#include "components/favicon/core/favicon_driver_observer.h"
#include "components/favicon/core/favicon_url.h"
@@ -144,17 +143,6 @@ class FaviconHandler {
static int GetMaximalIconSize(favicon_base::IconType icon_type);
private:
- // Represents an in progress download of an image from the renderer.
- struct DownloadRequest {
- DownloadRequest();
- ~DownloadRequest();
-
- DownloadRequest(const GURL& image_url, favicon_base::IconType icon_type);
-
- GURL image_url;
- favicon_base::IconType icon_type;
- };
-
// Used to track a candidate for the favicon.
struct FaviconCandidate {
FaviconCandidate();
@@ -200,6 +188,7 @@ class FaviconHandler {
// Triggered when a download of an image has finished.
void OnDidDownloadFavicon(
+ favicon_base::IconType icon_type,
int id,
int http_status_code,
const GURL& image_url,
@@ -268,8 +257,8 @@ class FaviconHandler {
bool redownload_icons_;
// Requests to the renderer to download favicons.
- typedef std::map<int, DownloadRequest> DownloadRequests;
- DownloadRequests download_requests_;
+ base::CancelableCallback<Delegate::ImageDownloadCallback::RunType>
+ download_request_;
// The combination of the supported icon types.
const int icon_types_;
@@ -302,8 +291,6 @@ class FaviconHandler {
// the image is for a favicon).
FaviconCandidate best_favicon_candidate_;
- base::WeakPtrFactory<FaviconHandler> weak_ptr_factory_;
-
DISALLOW_COPY_AND_ASSIGN(FaviconHandler);
};
« no previous file with comments | « no previous file | components/favicon/core/favicon_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698