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

Unified Diff: components/image_fetcher/core/image_fetcher.h

Issue 2781473003: Add |SetImageDownloadLimit| to ImageFetcher to limit downloaded bytes (Closed)
Patch Set: Test fix: Mock pure virtual Setter in CrOS notification test 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
Index: components/image_fetcher/core/image_fetcher.h
diff --git a/components/image_fetcher/core/image_fetcher.h b/components/image_fetcher/core/image_fetcher.h
index e1b121b3e338ca9045343a6e92103fe1c9db71e6..0284aee9f250d2869c11ff9032366fd81f8dafa1 100644
--- a/components/image_fetcher/core/image_fetcher.h
+++ b/components/image_fetcher/core/image_fetcher.h
@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "base/optional.h"
#include "components/data_use_measurement/core/data_use_user_data.h"
#include "components/image_fetcher/core/image_fetcher_delegate.h"
#include "url/gurl.h"
@@ -44,6 +45,12 @@ class ImageFetcher {
virtual void SetDataUseServiceName(
DataUseServiceName data_use_service_name) = 0;
+ // Sets an upper limit for image downloads that is by default disabled.
+ // Setting |max_download_bytes| to a negative value will disable the limit.
+ // Already running downloads are immediately affected.
+ virtual void SetImageDownloadLimit(
+ base::Optional<int64_t> max_download_bytes) = 0;
+
// Sets the desired size for images with multiple frames (like .ico files).
// By default, the image fetcher choses smaller images. Override to choose a
// frame with a size as close as possible to |size| (trying to take one in
« no previous file with comments | « components/image_fetcher/core/image_data_fetcher_unittest.cc ('k') | components/image_fetcher/core/image_fetcher_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698