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

Issue 2781473003: Add |SetImageDownloadLimit| to ImageFetcher to limit downloaded bytes (Closed)

Created:
3 years, 9 months ago by fhorschig
Modified:
3 years, 8 months ago
Reviewers:
Marc Treib
CC:
chromium-reviews, noyau+watch_chromium.org, ntp-dev+reviews_chromium.org, sky
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add |SetImageDownloadLimit| to ImageFetcher to limit downloaded bytes By calling SetImageDownloadLimit, the ImageFetcher will cancel requests that exceed the given byte size. This affects currently running and upcoming requests. The limit can be disabled by calling it with negative limits. By default, there is no limit set. Therefore, all existing users of image_data_fetchers are not affected. TBR'ing for ownership of two tests. The added functions are never used and exist just to implement the interface so the compiler is happy. TBR=sky@chromium.org BUG=702601 Review-Url: https://codereview.chromium.org/2781473003 Cr-Commit-Position: refs/heads/master@{#460059} Committed: https://chromium.googlesource.com/chromium/src/+/281080243642ac41b1004f9d8c6363db6081bbfa

Patch Set 1 : Add |SetImageDownloadLimit| to ImageDataFetcher #

Total comments: 36

Patch Set 2 : Use base::Optional<int64_t> #

Total comments: 8

Patch Set 3 : Remove "immediate" and const #

Patch Set 4 : s/LOG/DLOG #

Patch Set 5 : Test fix: Mock pure virtual Setter in CrOS notification test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -6 lines) Patch
M chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M components/favicon/core/large_icon_service_unittest.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M components/image_fetcher/core/image_data_fetcher.h View 1 2 4 chunks +17 lines, -1 line 0 comments Download
M components/image_fetcher/core/image_data_fetcher.cc View 1 2 3 4 chunks +36 lines, -5 lines 0 comments Download
M components/image_fetcher/core/image_data_fetcher_unittest.cc View 1 2 1 chunk +64 lines, -0 lines 0 comments Download
M components/image_fetcher/core/image_fetcher.h View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M components/image_fetcher/core/image_fetcher_impl.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M components/image_fetcher/core/image_fetcher_impl.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M components/ntp_tiles/icon_cacher_impl_unittest.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M components/suggestions/image_manager_unittest.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (13 generated)
fhorschig
Hi Marc, would you please have a look? https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc File components/image_fetcher/core/image_data_fetcher.cc (right): https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc#newcode115 components/image_fetcher/core/image_data_fetcher.cc:115: auto ...
3 years, 9 months ago (2017-03-27 12:57:25 UTC) #4
fhorschig
Hi Marc, would you please have a look? https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc File components/image_fetcher/core/image_data_fetcher.cc (right): https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc#newcode115 components/image_fetcher/core/image_data_fetcher.cc:115: auto ...
3 years, 9 months ago (2017-03-27 12:57:25 UTC) #5
Marc Treib
https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc File components/image_fetcher/core/image_data_fetcher.cc (right): https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc#newcode115 components/image_fetcher/core/image_data_fetcher.cc:115: auto request_iter = pending_requests_.find(source); On 2017/03/27 12:57:25, fhorschig wrote: ...
3 years, 9 months ago (2017-03-27 13:16:43 UTC) #6
fhorschig
https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc File components/image_fetcher/core/image_data_fetcher.cc (right): https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc#newcode115 components/image_fetcher/core/image_data_fetcher.cc:115: auto request_iter = pending_requests_.find(source); On 2017/03/27 13:16:42, Marc Treib ...
3 years, 9 months ago (2017-03-27 14:33:43 UTC) #7
Marc Treib
https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc File components/image_fetcher/core/image_data_fetcher.cc (right): https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc#newcode115 components/image_fetcher/core/image_data_fetcher.cc:115: auto request_iter = pending_requests_.find(source); On 2017/03/27 14:33:43, fhorschig wrote: ...
3 years, 9 months ago (2017-03-27 14:49:18 UTC) #8
fhorschig
https://codereview.chromium.org/2781473003/diff/40001/components/image_fetcher/core/image_data_fetcher.cc File components/image_fetcher/core/image_data_fetcher.cc (right): https://codereview.chromium.org/2781473003/diff/40001/components/image_fetcher/core/image_data_fetcher.cc#newcode120 components/image_fetcher/core/image_data_fetcher.cc:120: metadata.from_http_cache = false; On 2017/03/27 14:49:18, Marc Treib wrote: ...
3 years, 9 months ago (2017-03-27 16:33:34 UTC) #9
Marc Treib
LGTM with a last nit https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc File components/image_fetcher/core/image_data_fetcher.cc (right): https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc#newcode118 components/image_fetcher/core/image_data_fetcher.cc:118: LOG(WARNING) << "Image data ...
3 years, 9 months ago (2017-03-27 16:40:12 UTC) #12
fhorschig
https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc File components/image_fetcher/core/image_data_fetcher.cc (right): https://codereview.chromium.org/2781473003/diff/20001/components/image_fetcher/core/image_data_fetcher.cc#newcode118 components/image_fetcher/core/image_data_fetcher.cc:118: LOG(WARNING) << "Image data exceededs download size limit."; On ...
3 years, 8 months ago (2017-03-28 08:28:54 UTC) #15
Marc Treib
Thanks! Non-conditional lgtm now :)
3 years, 8 months ago (2017-03-28 08:48:14 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2781473003/100001
3 years, 8 months ago (2017-03-28 08:53:40 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/396127)
3 years, 8 months ago (2017-03-28 09:00:19 UTC) #20
Marc Treib
On 2017/03/28 09:00:19, commit-bot: I haz the power wrote: > Try jobs failed on following ...
3 years, 8 months ago (2017-03-28 10:07:59 UTC) #21
fhorschig
On 2017/03/28 10:07:59, Marc Treib wrote: > On 2017/03/28 09:00:19, commit-bot: I haz the power ...
3 years, 8 months ago (2017-03-28 10:51:21 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2781473003/100001
3 years, 8 months ago (2017-03-28 10:51:51 UTC) #25
commit-bot: I haz the power
3 years, 8 months ago (2017-03-28 10:56:08 UTC) #28
Message was sent while issue was closed.
Committed patchset #5 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/281080243642ac41b1004f9d8c63...

Powered by Google App Engine
This is Rietveld 408576698