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

Issue 2725143003: [Doodle] Pull time_to_live out of DoodleConfig (Closed)

Created:
3 years, 9 months ago by Marc Treib
Modified:
3 years, 9 months ago
Reviewers:
fhorschig, mastiz
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Doodle] Pull time_to_live out of DoodleConfig It didn't belong there, since by definition it can't be kept around. Also clients aren't interested in it, since the DoodleService will handle expiration. As a positive side effect, this allows us to implement DoodleConfig::operator==, which makes some things much nicer. This is a follow-up to https://codereview.chromium.org/2726883002/ BUG=690467 Review-Url: https://codereview.chromium.org/2725143003 Cr-Commit-Position: refs/heads/master@{#454559} Committed: https://chromium.googlesource.com/chromium/src/+/ebcd266f8e04c1ebebf3e0eca08f6683641cf613

Patch Set 1 #

Total comments: 6

Patch Set 2 : review #

Total comments: 12

Patch Set 3 : mastiz review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -96 lines) Patch
M components/doodle/doodle_fetcher.h View 2 chunks +7 lines, -1 line 0 comments Download
M components/doodle/doodle_fetcher_impl.h View 1 2 2 chunks +9 lines, -3 lines 0 comments Download
M components/doodle/doodle_fetcher_impl.cc View 1 2 5 chunks +24 lines, -13 lines 0 comments Download
M components/doodle/doodle_fetcher_impl_unittest.cc View 1 2 14 chunks +39 lines, -30 lines 0 comments Download
M components/doodle/doodle_service.h View 2 chunks +5 lines, -0 lines 0 comments Download
M components/doodle/doodle_service.cc View 2 chunks +9 lines, -19 lines 0 comments Download
M components/doodle/doodle_service_unittest.cc View 1 2 12 chunks +24 lines, -19 lines 0 comments Download
M components/doodle/doodle_types.h View 3 chunks +2 lines, -7 lines 0 comments Download
M components/doodle/doodle_types.cc View 2 chunks +5 lines, -4 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 28 (18 generated)
Marc Treib
Here's that follow-up I promised. PTAL! https://codereview.chromium.org/2725143003/diff/1/components/doodle/doodle_fetcher.h File components/doodle/doodle_fetcher.h (right): https://codereview.chromium.org/2725143003/diff/1/components/doodle/doodle_fetcher.h#newcode31 components/doodle/doodle_fetcher.h:31: const base::Optional<DoodleConfig>& doodle_config)>; ...
3 years, 9 months ago (2017-03-02 11:42:51 UTC) #4
fhorschig
lgtm w/ nits https://codereview.chromium.org/2725143003/diff/1/components/doodle/doodle_fetcher.h File components/doodle/doodle_fetcher.h (right): https://codereview.chromium.org/2725143003/diff/1/components/doodle/doodle_fetcher.h#newcode31 components/doodle/doodle_fetcher.h:31: const base::Optional<DoodleConfig>& doodle_config)>; On 2017/03/02 11:42:51, ...
3 years, 9 months ago (2017-03-02 13:18:08 UTC) #7
Marc Treib
https://codereview.chromium.org/2725143003/diff/1/components/doodle/doodle_fetcher_impl.cc File components/doodle/doodle_fetcher_impl.cc (right): https://codereview.chromium.org/2725143003/diff/1/components/doodle/doodle_fetcher_impl.cc#newcode167 components/doodle/doodle_fetcher_impl.cc:167: ParseBaseInformation(ddljson, &doodle, time_to_live); On 2017/03/02 13:18:08, fhorschig wrote: > ...
3 years, 9 months ago (2017-03-02 14:30:08 UTC) #8
Marc Treib
+mastiz: Once again, committer's approval please? :)
3 years, 9 months ago (2017-03-02 14:30:53 UTC) #12
mastiz
LGTM with optional comments. https://codereview.chromium.org/2725143003/diff/20001/components/doodle/doodle_fetcher_impl.h File components/doodle/doodle_fetcher_impl.h (right): https://codereview.chromium.org/2725143003/diff/20001/components/doodle/doodle_fetcher_impl.h#newcode67 components/doodle/doodle_fetcher_impl.h:67: base::TimeDelta* time_to_live) const; Optional: wouldn't ...
3 years, 9 months ago (2017-03-02 19:55:42 UTC) #15
fhorschig
https://codereview.chromium.org/2725143003/diff/20001/components/doodle/doodle_service_unittest.cc File components/doodle/doodle_service_unittest.cc (right): https://codereview.chromium.org/2725143003/diff/20001/components/doodle/doodle_service_unittest.cc#newcode67 components/doodle/doodle_service_unittest.cc:67: base::TimeDelta some_time() const { return base::TimeDelta::FromHours(1); } On 2017/03/02 ...
3 years, 9 months ago (2017-03-02 20:18:56 UTC) #16
Marc Treib
Thanks! Some comments addressed ;) https://codereview.chromium.org/2725143003/diff/20001/components/doodle/doodle_fetcher_impl.h File components/doodle/doodle_fetcher_impl.h (right): https://codereview.chromium.org/2725143003/diff/20001/components/doodle/doodle_fetcher_impl.h#newcode67 components/doodle/doodle_fetcher_impl.h:67: base::TimeDelta* time_to_live) const; On ...
3 years, 9 months ago (2017-03-03 09:35:26 UTC) #19
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/2725143003/40001
3 years, 9 months ago (2017-03-03 10:12:26 UTC) #24
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/ebcd266f8e04c1ebebf3e0eca08f6683641cf613
3 years, 9 months ago (2017-03-03 10:17:05 UTC) #27
mastiz
3 years, 9 months ago (2017-03-03 11:17:44 UTC) #28
Message was sent while issue was closed.
https://codereview.chromium.org/2725143003/diff/20001/components/doodle/doodl...
File components/doodle/doodle_fetcher_impl.h (right):

https://codereview.chromium.org/2725143003/diff/20001/components/doodle/doodl...
components/doodle/doodle_fetcher_impl.h:79: const base::Optional<DoodleConfig>&
config);
On 2017/03/03 09:35:26, Marc Treib wrote:
> On 2017/03/02 19:55:42, mastiz wrote:
> > Ditto: perhaps a typedef or struct could also help.
> 
> Same: Unless you feel strongly, I don't think it's worth it.

I was certainly not feeling strongly, so it's fine. What I dislike about the
current signature is that it's not clear that the function returns both or
neither.

https://codereview.chromium.org/2725143003/diff/20001/components/doodle/doodl...
File components/doodle/doodle_service_unittest.cc (right):

https://codereview.chromium.org/2725143003/diff/20001/components/doodle/doodl...
components/doodle/doodle_service_unittest.cc:67: base::TimeDelta some_time()
const { return base::TimeDelta::FromHours(1); }
On 2017/03/03 09:35:26, Marc Treib wrote:
> On 2017/03/02 19:55:42, mastiz wrote:
> > Use a constant instead, kSomeTime?
> 
> Constants of non-trivial types are mostly disallowed, because we don't like
> static initializers.
> 
> I've just inlined it below, since the helper really doesn't save much anyway.

Right, the solution is to not make it static. Simply a public (or protected)
variable that is const or constexpr.

Powered by Google App Engine
This is Rietveld 408576698