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

Issue 2162533002: Adding a request counter to the snippets fetcher. (Closed)

Created:
4 years, 5 months ago by jkrcal
Modified:
4 years, 4 months ago
CC:
chromium-reviews, asvitkine+watch_chromium.org, ntp-dev+reviews_chromium.org, sdefresne+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@traffic-monitor
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Adding a request counter to the snippets fetcher. This CL applies the RequestCounter to NTPSnippetsFetcher. BUG=627073 Committed: https://crrev.com/2d194db915724d87d566e558d87296a4f6d367da Cr-Commit-Position: refs/heads/master@{#407769}

Patch Set 1 #

Patch Set 2 : A minor fix #

Patch Set 3 : Updating to new RequestCounter API #

Patch Set 4 : Minor fixes #

Patch Set 5 : Rebase + rename to throttler #

Total comments: 15

Patch Set 6 : Rebase #

Patch Set 7 : Marc's and Bernhard's comments #

Total comments: 5

Patch Set 8 : Marc's comments #

Total comments: 2

Patch Set 9 : Bernhard's and Eric's comments #

Total comments: 4

Patch Set 10 : Fix the unittest #

Total comments: 2

Patch Set 11 : Bernhard's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -71 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/android/ntp/ntp_snippets_bridge.cc View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/webui/snippets_internals_message_handler.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M components/ntp_snippets/ntp_snippets_fetcher.h View 1 2 3 4 5 6 5 chunks +12 lines, -1 line 0 comments Download
M components/ntp_snippets/ntp_snippets_fetcher.cc View 1 2 3 4 5 6 7 3 chunks +9 lines, -1 line 0 comments Download
M components/ntp_snippets/ntp_snippets_fetcher_unittest.cc View 1 2 3 4 5 6 15 chunks +41 lines, -21 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.h View 1 2 3 4 5 6 1 chunk +7 lines, -2 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.cc View 1 2 3 4 5 6 3 chunks +7 lines, -6 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service_unittest.cc View 1 2 3 4 4 chunks +5 lines, -3 lines 0 comments Download
M components/ntp_snippets/request_throttler.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +8 lines, -5 lines 0 comments Download
M components/ntp_snippets/request_throttler.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +13 lines, -15 lines 0 comments Download
M components/ntp_snippets/request_throttler_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -2 lines 0 comments Download
M ios/chrome/browser/ntp_snippets/ios_chrome_ntp_snippets_service_factory.cc View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -7 lines 0 comments Download

Messages

Total messages: 38 (20 generated)
jkrcal
Marc, PTAL at the components/ntp_snippets/ code. Berhnard, PTAL at the java + bridge code. Éric, ...
4 years, 5 months ago (2016-07-22 13:44:27 UTC) #7
Marc Treib
https://codereview.chromium.org/2162533002/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2162533002/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode79 components/ntp_snippets/ntp_snippets_fetcher.cc:79: const int kArticlesQuotaPerDay = 20; This sounds like "number ...
4 years, 5 months ago (2016-07-22 13:52:53 UTC) #8
Bernhard Bauer
lgtm https://codereview.chromium.org/2162533002/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.h File components/ntp_snippets/ntp_snippets_fetcher.h (right): https://codereview.chromium.org/2162533002/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.h#newcode98 components/ntp_snippets/ntp_snippets_fetcher.h:98: // Fetches snippets only if the daily quota ...
4 years, 5 months ago (2016-07-22 13:59:14 UTC) #9
jkrcal
Thanks! Éric, PTAL at the iOS factory. https://codereview.chromium.org/2162533002/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2162533002/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode79 components/ntp_snippets/ntp_snippets_fetcher.cc:79: const int ...
4 years, 5 months ago (2016-07-25 10:05:38 UTC) #10
jkrcal
https://codereview.chromium.org/2162533002/diff/120001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2162533002/diff/120001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode79 components/ntp_snippets/ntp_snippets_fetcher.cc:79: const int kContentFetchesQuotaPerDay = 30; I still wonder what ...
4 years, 5 months ago (2016-07-25 10:08:26 UTC) #13
Marc Treib
https://codereview.chromium.org/2162533002/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2162533002/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode79 components/ntp_snippets/ntp_snippets_fetcher.cc:79: const int kArticlesQuotaPerDay = 20; On 2016/07/25 10:05:38, jkrcal ...
4 years, 5 months ago (2016-07-25 10:11:55 UTC) #14
jkrcal
Thanks, Marc! https://codereview.chromium.org/2162533002/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2162533002/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode79 components/ntp_snippets/ntp_snippets_fetcher.cc:79: const int kArticlesQuotaPerDay = 20; On 2016/07/25 ...
4 years, 5 months ago (2016-07-25 10:26:59 UTC) #15
Marc Treib
https://codereview.chromium.org/2162533002/diff/120001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2162533002/diff/120001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode79 components/ntp_snippets/ntp_snippets_fetcher.cc:79: const int kContentFetchesQuotaPerDay = 30; On 2016/07/25 10:26:59, jkrcal ...
4 years, 5 months ago (2016-07-25 11:07:46 UTC) #16
noyau (Ping after 24h)
https://codereview.chromium.org/2162533002/diff/140001/ios/chrome/browser/ntp_snippets/ios_chrome_ntp_snippets_service_factory.cc File ios/chrome/browser/ntp_snippets/ios_chrome_ntp_snippets_service_factory.cc (right): https://codereview.chromium.org/2162533002/diff/140001/ios/chrome/browser/ntp_snippets/ios_chrome_ntp_snippets_service_factory.cc#newcode123 ios/chrome/browser/ntp_snippets/ios_chrome_ntp_snippets_service_factory.cc:123: chrome_browser_state->GetPrefs(), base::Bind(&ParseJson), GetPrefs() is called twice on this long ...
4 years, 5 months ago (2016-07-25 11:54:52 UTC) #17
jkrcal
Thanks, Éric! Berhnard, I addressed your post-commit comment from 2158843002 here. Could you PTAL once ...
4 years, 4 months ago (2016-07-26 08:30:11 UTC) #18
noyau (Ping after 24h)
lgtm
4 years, 4 months ago (2016-07-26 08:34:13 UTC) #19
Bernhard Bauer
Thanks! https://codereview.chromium.org/2162533002/diff/160001/components/ntp_snippets/request_throttler.h File components/ntp_snippets/request_throttler.h (right): https://codereview.chromium.org/2162533002/diff/160001/components/ntp_snippets/request_throttler.h#newcode59 components/ntp_snippets/request_throttler.h:59: struct RequestTypeInfo { Do you need to define ...
4 years, 4 months ago (2016-07-26 09:52:46 UTC) #24
jkrcal
Thanks! https://codereview.chromium.org/2162533002/diff/160001/components/ntp_snippets/request_throttler.h File components/ntp_snippets/request_throttler.h (right): https://codereview.chromium.org/2162533002/diff/160001/components/ntp_snippets/request_throttler.h#newcode59 components/ntp_snippets/request_throttler.h:59: struct RequestTypeInfo { On 2016/07/26 09:52:45, Bernhard Bauer ...
4 years, 4 months ago (2016-07-26 10:05:07 UTC) #25
Bernhard Bauer
LGTM, thanks!
4 years, 4 months ago (2016-07-26 10:07:53 UTC) #28
Marc Treib
lgtm https://codereview.chromium.org/2162533002/diff/180001/components/ntp_snippets/request_throttler_unittest.cc File components/ntp_snippets/request_throttler_unittest.cc (right): https://codereview.chromium.org/2162533002/diff/180001/components/ntp_snippets/request_throttler_unittest.cc#newcode29 components/ntp_snippets/request_throttler_unittest.cc:29: throttler_->quota_ = kCounterQuota; On 2016/07/26 10:05:07, jkrcal wrote: ...
4 years, 4 months ago (2016-07-26 10:10:17 UTC) #29
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/2162533002/200001
4 years, 4 months ago (2016-07-26 11:23:30 UTC) #34
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 4 months ago (2016-07-26 11:27:10 UTC) #36
commit-bot: I haz the power
4 years, 4 months ago (2016-07-26 11:29:11 UTC) #38
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/2d194db915724d87d566e558d87296a4f6d367da
Cr-Commit-Position: refs/heads/master@{#407769}

Powered by Google App Engine
This is Rietveld 408576698