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

Issue 2660883002: Introduce a Doodle Fetcher for NTP (Closed)

Created:
3 years, 10 months ago by fhorschig
Modified:
3 years, 10 months ago
CC:
chromium-reviews, skanuj+watch_chromium.org, melevin+watch_chromium.org, droger+watchlist_chromium.org, blundell+watchlist_chromium.org, donnd+watch_chromium.org, sdefresne+watchlist_chromium.org, jfweitz+watch_chromium.org, David Black, samarth+watch_chromium.org, kmadhusu+watch_chromium.org, Jered, Marc Treib, jshneier
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce a Doodle Fetcher for NTP This fetcher queries the standard Doodle endpoint [1] and converts the config into a struct. Attributes are checked for sanity and converted into fitting formats (e.g. expiry_date based on TTL value). [1] www.google.com/async/ddljson. BUG=690467 Review-Url: https://codereview.chromium.org/2660883002 Cr-Commit-Position: refs/heads/master@{#450954} Committed: https://chromium.googlesource.com/chromium/src/+/5ba57aa78c96c678de1cdf6c34ffe9fefae21a6e

Patch Set 1 #

Patch Set 2 : Image URL successfully fetched. #

Patch Set 3 : Proper parsing of the ddljson properties. #

Patch Set 4 : DoodleState informs about availability of a doodle. #

Patch Set 5 : Add namespace and relative URLs #

Patch Set 6 : Tests work. #

Total comments: 17

Patch Set 7 : Add injectable JSON parser and tested expiry_time. #

Total comments: 43

Patch Set 8 : Thread-safe multiple callbacks. Weak tests. #

Total comments: 4

Patch Set 9 : Change interface for |FetchDoodle| #

Total comments: 59

Patch Set 10 : CMD line BaseUrl. [Rebase, Weak tests] #

Total comments: 14

Patch Set 11 : Tests for URL and TTL. Stubs/Fakes instead nullptr. #

Total comments: 6

Patch Set 12 : Tests use TestURLFetcher instead of waiting calls. #

Patch Set 13 : Rebase. #

Total comments: 28

Patch Set 14 : Set TTL to 30 days #

Total comments: 14

Patch Set 15 : Inline JSON responses in tests #

Total comments: 20

Patch Set 16 : Address comments #

Total comments: 16

Patch Set 17 : Revert and refactor condition for running requests #

Total comments: 2

Patch Set 18 : Address some more comments #

Total comments: 2

Patch Set 19 : Removed unnecessary constructor. #

Total comments: 15

Patch Set 20 : Clean dependencies and s/ptr/scoped_refptr #

Total comments: 2

Patch Set 21 : Remove unused context_getter #

Unified diffs Side-by-side diffs Delta from patch set Stats (+865 lines, -0 lines) Patch
M components/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
A components/doodle/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +30 lines, -0 lines 0 comments Download
A components/doodle/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +6 lines, -0 lines 0 comments Download
A components/doodle/OWNERS View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A components/doodle/doodle_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +162 lines, -0 lines 0 comments Download
A components/doodle/doodle_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +240 lines, -0 lines 0 comments Download
A components/doodle/doodle_fetcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +425 lines, -0 lines 0 comments Download

Messages

Total messages: 86 (49 generated)
Marc Treib
Bunch of small comments :) https://codereview.chromium.org/2660883002/diff/140001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/140001/components/doodle/doodle_fetcher.cc#newcode39 components/doodle/doodle_fetcher.cc:39: safe_json::SafeJsonParser::Parse(json_sp.as_string(), success_callback, This is ...
3 years, 10 months ago (2017-01-31 09:46:34 UTC) #4
jshneier
https://codereview.chromium.org/2660883002/diff/140001/components/doodle/doodle_fetcher.h File components/doodle/doodle_fetcher.h (right): https://codereview.chromium.org/2660883002/diff/140001/components/doodle/doodle_fetcher.h#newcode53 components/doodle/doodle_fetcher.h:53: std::string doodle_type; On 2017/01/31 09:46:34, Marc Treib wrote: > ...
3 years, 10 months ago (2017-01-31 13:08:27 UTC) #5
fhorschig
https://codereview.chromium.org/2660883002/diff/140001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/140001/components/doodle/doodle_fetcher.cc#newcode39 components/doodle/doodle_fetcher.cc:39: safe_json::SafeJsonParser::Parse(json_sp.as_string(), success_callback, On 2017/01/31 09:46:34, Marc Treib wrote: > ...
3 years, 10 months ago (2017-01-31 13:59:19 UTC) #6
Marc Treib
https://codereview.chromium.org/2660883002/diff/180001/components/doodle/OWNERS File components/doodle/OWNERS (right): https://codereview.chromium.org/2660883002/diff/180001/components/doodle/OWNERS#newcode1 components/doodle/OWNERS:1: fhorschig@chromium.org You can't be an owner before you're a ...
3 years, 10 months ago (2017-01-31 14:46:39 UTC) #7
Marc Treib
https://codereview.chromium.org/2660883002/diff/200001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/200001/components/doodle/doodle_fetcher.cc#newcode102 components/doodle/doodle_fetcher.cc:102: callback_lock_.Acquire(); Is this required? I don't see why we ...
3 years, 10 months ago (2017-02-01 10:55:59 UTC) #8
fhorschig
https://codereview.chromium.org/2660883002/diff/180001/components/doodle/OWNERS File components/doodle/OWNERS (right): https://codereview.chromium.org/2660883002/diff/180001/components/doodle/OWNERS#newcode1 components/doodle/OWNERS:1: fhorschig@chromium.org On 2017/01/31 14:46:38, Marc Treib wrote: > You ...
3 years, 10 months ago (2017-02-01 11:16:14 UTC) #11
Marc Treib
Lots of comments, but mostly small stuff. https://codereview.chromium.org/2660883002/diff/180001/components/doodle/OWNERS File components/doodle/OWNERS (right): https://codereview.chromium.org/2660883002/diff/180001/components/doodle/OWNERS#newcode1 components/doodle/OWNERS:1: fhorschig@chromium.org On ...
3 years, 10 months ago (2017-02-01 11:53:14 UTC) #12
Marc Treib
https://codereview.chromium.org/2660883002/diff/260001/components/doodle/doodle_fetcher_unittest.cc File components/doodle/doodle_fetcher_unittest.cc (right): https://codereview.chromium.org/2660883002/diff/260001/components/doodle/doodle_fetcher_unittest.cc#newcode31 components/doodle/doodle_fetcher_unittest.cc:31: const char kSampleResponse[] = R"json()]}'{ On 2017/02/01 11:53:14, Marc ...
3 years, 10 months ago (2017-02-01 14:08:05 UTC) #13
Marc Treib
https://codereview.chromium.org/2660883002/diff/260001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/260001/components/doodle/doodle_fetcher.cc#newcode217 components/doodle/doodle_fetcher.cc:217: return google_url_tracker_->google_url(); Turns out the tracker doesn't respect the ...
3 years, 10 months ago (2017-02-01 15:22:02 UTC) #14
fhorschig
https://codereview.chromium.org/2660883002/diff/260001/components/doodle/BUILD.gn File components/doodle/BUILD.gn (right): https://codereview.chromium.org/2660883002/diff/260001/components/doodle/BUILD.gn#newcode13 components/doodle/BUILD.gn:13: "//components/google/core/browser:browser", On 2017/02/01 11:53:13, Marc Treib wrote: > nit: ...
3 years, 10 months ago (2017-02-03 13:21:05 UTC) #15
Marc Treib
https://codereview.chromium.org/2660883002/diff/260001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/260001/components/doodle/doodle_fetcher.cc#newcode215 components/doodle/doodle_fetcher.cc:215: // tests, too. On 2017/02/03 13:21:04, fhorschig wrote: > ...
3 years, 10 months ago (2017-02-03 15:45:49 UTC) #16
fhorschig
https://codereview.chromium.org/2660883002/diff/180001/components/doodle/doodle_fetcher.h File components/doodle/doodle_fetcher.h (right): https://codereview.chromium.org/2660883002/diff/180001/components/doodle/doodle_fetcher.h#newcode150 components/doodle/doodle_fetcher.h:150: extern const char kDoodleConfigUrl[]; On 2017/02/01 11:53:13, Marc Treib ...
3 years, 10 months ago (2017-02-06 11:48:22 UTC) #18
Marc Treib
Some last comments; looking pretty good now! One more thing to do is to replace ...
3 years, 10 months ago (2017-02-06 17:26:36 UTC) #23
jshneier
https://codereview.chromium.org/2660883002/diff/280001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/280001/components/doodle/doodle_fetcher.cc#newcode195 components/doodle/doodle_fetcher.cc:195: } On 2017/02/06 17:26:35, Marc Treib wrote: > On ...
3 years, 10 months ago (2017-02-06 19:02:40 UTC) #25
Marc Treib
https://codereview.chromium.org/2660883002/diff/280001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/280001/components/doodle/doodle_fetcher.cc#newcode195 components/doodle/doodle_fetcher.cc:195: } On 2017/02/06 19:02:40, jshneier wrote: > On 2017/02/06 ...
3 years, 10 months ago (2017-02-07 09:21:10 UTC) #26
fhorschig
As soon as there is an "interactive_js" key, it will be parsed. (Also LOGs replaced ...
3 years, 10 months ago (2017-02-08 09:10:24 UTC) #32
Marc Treib
I'm officially nitpicking now ;) https://codereview.chromium.org/2660883002/diff/280001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/280001/components/doodle/doodle_fetcher.cc#newcode195 components/doodle/doodle_fetcher.cc:195: } On 2017/02/08 09:10:23, ...
3 years, 10 months ago (2017-02-08 10:51:37 UTC) #35
fhorschig
https://codereview.chromium.org/2660883002/diff/280001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/280001/components/doodle/doodle_fetcher.cc#newcode195 components/doodle/doodle_fetcher.cc:195: } On 2017/02/08 10:51:36, Marc Treib wrote: > On ...
3 years, 10 months ago (2017-02-08 18:37:26 UTC) #36
Marc Treib
Thanks! LGTM with some more test nits/suggestions (but please hold off on landing this for ...
3 years, 10 months ago (2017-02-09 10:36:25 UTC) #37
fhorschig
Okay, I will wait with involving OWNERS until we actually need this change landed. https://codereview.chromium.org/2660883002/diff/370008/components/doodle/doodle_fetcher_unittest.cc ...
3 years, 10 months ago (2017-02-09 13:23:56 UTC) #38
Marc Treib
Did one more pass and found a few more nits ;) Otherwise, I think we ...
3 years, 10 months ago (2017-02-10 10:28:48 UTC) #45
fhorschig
Title and description adjusted. https://codereview.chromium.org/2660883002/diff/450001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/450001/components/doodle/doodle_fetcher.cc#newcode19 components/doodle/doodle_fetcher.cc:19: #include "url/gurl.h" On 2017/02/10 10:28:47, ...
3 years, 10 months ago (2017-02-13 09:20:57 UTC) #48
fhorschig
Hi sdefresne@, would you please have a look whether the doodle fetcher fits into components/?
3 years, 10 months ago (2017-02-13 09:26:30 UTC) #50
Marc Treib
https://codereview.chromium.org/2660883002/diff/470001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/470001/components/doodle/doodle_fetcher.cc#newcode94 components/doodle/doodle_fetcher.cc:94: DCHECK(!fetcher_.get()); nit: Now the DCHECK isn't required anymore, since ...
3 years, 10 months ago (2017-02-13 09:48:40 UTC) #53
fhorschig
https://codereview.chromium.org/2660883002/diff/470001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/470001/components/doodle/doodle_fetcher.cc#newcode94 components/doodle/doodle_fetcher.cc:94: DCHECK(!fetcher_.get()); On 2017/02/13 09:48:40, Marc Treib wrote: > nit: ...
3 years, 10 months ago (2017-02-13 11:01:31 UTC) #60
Marc Treib
https://codereview.chromium.org/2660883002/diff/470001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/470001/components/doodle/doodle_fetcher.cc#newcode223 components/doodle/doodle_fetcher.cc:223: std::unique_ptr<net::URLFetcher> free_fetcher = std::move(fetcher_); On 2017/02/13 11:01:26, fhorschig wrote: ...
3 years, 10 months ago (2017-02-13 11:12:50 UTC) #61
fhorschig
https://codereview.chromium.org/2660883002/diff/470001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/470001/components/doodle/doodle_fetcher.cc#newcode223 components/doodle/doodle_fetcher.cc:223: std::unique_ptr<net::URLFetcher> free_fetcher = std::move(fetcher_); On 2017/02/13 11:12:49, Marc Treib ...
3 years, 10 months ago (2017-02-13 13:06:22 UTC) #62
sdefresne
lgtm https://codereview.chromium.org/2660883002/diff/510001/components/doodle/doodle_fetcher.h File components/doodle/doodle_fetcher.h (right): https://codereview.chromium.org/2660883002/diff/510001/components/doodle/doodle_fetcher.h#newcode55 components/doodle/doodle_fetcher.h:55: explicit DoodleImage(GURL url); Two questions: 1. why is ...
3 years, 10 months ago (2017-02-13 15:55:26 UTC) #63
fhorschig
Thank you for the timely response! https://codereview.chromium.org/2660883002/diff/510001/components/doodle/doodle_fetcher.h File components/doodle/doodle_fetcher.h (right): https://codereview.chromium.org/2660883002/diff/510001/components/doodle/doodle_fetcher.h#newcode55 components/doodle/doodle_fetcher.h:55: explicit DoodleImage(GURL url); ...
3 years, 10 months ago (2017-02-13 17:25:51 UTC) #64
fhorschig
Hi mattm@, Would you please review my CL? This fetcher introduces dependencies to net/.
3 years, 10 months ago (2017-02-14 09:18:39 UTC) #70
mattm
https://codereview.chromium.org/2660883002/diff/530001/components/doodle/DEPS File components/doodle/DEPS (right): https://codereview.chromium.org/2660883002/diff/530001/components/doodle/DEPS#newcode3 components/doodle/DEPS:3: "+net", Prefer to keep include rules more focused, eg: ...
3 years, 10 months ago (2017-02-14 22:37:14 UTC) #71
Marc Treib
https://codereview.chromium.org/2660883002/diff/530001/components/doodle/doodle_fetcher.cc File components/doodle/doodle_fetcher.cc (right): https://codereview.chromium.org/2660883002/diff/530001/components/doodle/doodle_fetcher.cc#newcode87 components/doodle/doodle_fetcher.cc:87: DoodleFetcher::~DoodleFetcher() = default; On 2017/02/14 22:37:14, mattm wrote: > ...
3 years, 10 months ago (2017-02-15 09:07:23 UTC) #72
fhorschig
https://codereview.chromium.org/2660883002/diff/530001/components/doodle/DEPS File components/doodle/DEPS (right): https://codereview.chromium.org/2660883002/diff/530001/components/doodle/DEPS#newcode3 components/doodle/DEPS:3: "+net", On 2017/02/14 22:37:14, mattm wrote: > Prefer to ...
3 years, 10 months ago (2017-02-15 10:49:51 UTC) #74
mattm
lgtm w/nit https://codereview.chromium.org/2660883002/diff/570001/components/doodle/doodle_fetcher_unittest.cc File components/doodle/doodle_fetcher_unittest.cc (right): https://codereview.chromium.org/2660883002/diff/570001/components/doodle/doodle_fetcher_unittest.cc#newcode145 components/doodle/doodle_fetcher_unittest.cc:145: scoped_refptr<net::TestURLRequestContextGetter> context_getter_; unused now?
3 years, 10 months ago (2017-02-15 20:17:28 UTC) #75
fhorschig
https://codereview.chromium.org/2660883002/diff/570001/components/doodle/doodle_fetcher_unittest.cc File components/doodle/doodle_fetcher_unittest.cc (right): https://codereview.chromium.org/2660883002/diff/570001/components/doodle/doodle_fetcher_unittest.cc#newcode145 components/doodle/doodle_fetcher_unittest.cc:145: scoped_refptr<net::TestURLRequestContextGetter> context_getter_; On 2017/02/15 20:17:27, mattm wrote: > unused ...
3 years, 10 months ago (2017-02-16 08:45:22 UTC) #78
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/2660883002/590001
3 years, 10 months ago (2017-02-16 14:24:12 UTC) #83
commit-bot: I haz the power
3 years, 10 months ago (2017-02-16 14:28:53 UTC) #86
Message was sent while issue was closed.
Committed patchset #21 (id:590001) as
https://chromium.googlesource.com/chromium/src/+/5ba57aa78c96c678de1cdf6c34ff...

Powered by Google App Engine
This is Rietveld 408576698