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

Issue 1370493002: Enable history counting for time ranges. (Closed)

Created:
5 years, 3 months ago by msramek
Modified:
5 years, 2 months ago
Reviewers:
lwchkg, sdefresne
CC:
chromium-reviews, lwchkg
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Enable history counting for time ranges. GetHistoryCount() previously counted all of browsing history. This can be now achieved by calling GetHistoryCount(base::Time(), base::Time::Max()). However, it's also possible to specify a narrower time interval. BUG=510028 Committed: https://crrev.com/7550cde6da3c3508b8a19ff06b6fa9eb1aaeba87 Cr-Commit-Position: refs/heads/master@{#351298}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Test DST. #

Total comments: 8

Patch Set 3 : Addressed comments. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -23 lines) Patch
M components/history/core/browser/history_backend.h View 1 chunk +6 lines, -5 lines 0 comments Download
M components/history/core/browser/history_backend.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M components/history/core/browser/history_service.h View 1 chunk +6 lines, -4 lines 0 comments Download
M components/history/core/browser/history_service.cc View 2 chunks +6 lines, -1 line 0 comments Download
M components/history/core/browser/visit_database.h View 1 chunk +9 lines, -7 lines 0 comments Download
M components/history/core/browser/visit_database.cc View 3 chunks +9 lines, -4 lines 0 comments Download
M components/history/core/browser/visit_database_unittest.cc View 1 2 1 chunk +172 lines, -0 lines 4 comments Download

Messages

Total messages: 18 (3 generated)
msramek
Hi Sylvain, can you please have a look? Thanks, Martin
5 years, 3 months ago (2015-09-24 15:06:31 UTC) #2
msramek
+cc lwchkg@ FYI When this lands, please use GetHistoryCount(base::Time(), base::Time::Max()) in https://codereview.chromium.org/1248613003/
5 years, 3 months ago (2015-09-24 15:07:48 UTC) #3
lwchkg
Thanks for working the unit test for me. BTW, here are a few comments. WC ...
5 years, 2 months ago (2015-09-25 04:06:35 UTC) #5
lwchkg
One more comment carried from our past CL: https://codereview.chromium.org/1345473003/ https://codereview.chromium.org/1370493002/diff/1/components/history/core/browser/visit_database.cc File components/history/core/browser/visit_database.cc (right): https://codereview.chromium.org/1370493002/diff/1/components/history/core/browser/visit_database.cc#newcode558 components/history/core/browser/visit_database.cc:558: ...
5 years, 2 months ago (2015-09-25 04:15:03 UTC) #6
msramek
https://codereview.chromium.org/1370493002/diff/1/components/history/core/browser/visit_database.cc File components/history/core/browser/visit_database.cc (right): https://codereview.chromium.org/1370493002/diff/1/components/history/core/browser/visit_database.cc#newcode558 components/history/core/browser/visit_database.cc:558: statement.BindInt64(0, base::Time::kTimeTToMicrosecondsOffset); On 2015/09/25 04:15:02, lwchkg wrote: > Just ...
5 years, 2 months ago (2015-09-25 10:44:35 UTC) #7
lwchkg
Just some other comments. Please check. Thanks. https://codereview.chromium.org/1370493002/diff/20001/components/history/core/browser/visit_database_unittest.cc File components/history/core/browser/visit_database_unittest.cc (right): https://codereview.chromium.org/1370493002/diff/20001/components/history/core/browser/visit_database_unittest.cc#newcode532 components/history/core/browser/visit_database_unittest.cc:532: for (int ...
5 years, 2 months ago (2015-09-28 18:14:52 UTC) #8
sdefresne
https://codereview.chromium.org/1370493002/diff/20001/components/history/core/browser/visit_database_unittest.cc File components/history/core/browser/visit_database_unittest.cc (right): https://codereview.chromium.org/1370493002/diff/20001/components/history/core/browser/visit_database_unittest.cc#newcode428 components/history/core/browser/visit_database_unittest.cc:428: Time tomorrow = (today + TimeDelta::FromHours(36)).LocalMidnight(); nit: this confused ...
5 years, 2 months ago (2015-09-29 08:21:49 UTC) #9
msramek
https://codereview.chromium.org/1370493002/diff/20001/components/history/core/browser/visit_database_unittest.cc File components/history/core/browser/visit_database_unittest.cc (right): https://codereview.chromium.org/1370493002/diff/20001/components/history/core/browser/visit_database_unittest.cc#newcode428 components/history/core/browser/visit_database_unittest.cc:428: Time tomorrow = (today + TimeDelta::FromHours(36)).LocalMidnight(); On 2015/09/29 08:21:49, ...
5 years, 2 months ago (2015-09-29 11:04:41 UTC) #10
sdefresne
lgtm
5 years, 2 months ago (2015-09-29 12:43:05 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1370493002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1370493002/40001
5 years, 2 months ago (2015-09-29 12:51:09 UTC) #13
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 2 months ago (2015-09-29 13:05:09 UTC) #14
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/7550cde6da3c3508b8a19ff06b6fa9eb1aaeba87 Cr-Commit-Position: refs/heads/master@{#351298}
5 years, 2 months ago (2015-09-29 13:05:47 UTC) #15
lwchkg
Some comments again (there are still some issues with the code.) https://codereview.chromium.org/1370493002/diff/40001/components/history/core/browser/visit_database_unittest.cc File components/history/core/browser/visit_database_unittest.cc (right): ...
5 years, 2 months ago (2015-10-01 17:01:48 UTC) #16
Mike Lerman
On 2015/10/01 17:01:48, lwchkg wrote: > Some comments again (there are still some issues with ...
5 years, 2 months ago (2015-10-01 19:31:47 UTC) #17
msramek
5 years, 2 months ago (2015-10-06 16:07:27 UTC) #18
Message was sent while issue was closed.
https://codereview.chromium.org/1370493002/diff/40001/components/history/core...
File components/history/core/browser/visit_database_unittest.cc (right):

https://codereview.chromium.org/1370493002/diff/40001/components/history/core...
components/history/core/browser/visit_database_unittest.cc:428: Time yesterday =
(today - TimeDelta::FromHours(36)).LocalMidnight();
On 2015/10/01 17:01:48, lwchkg wrote:
> It should be (today - TimeDelta::FromSeconds(1)).LocalMidnight();

Oops! And it passes the test perfectly anyway, because the intervals are always
based on the three time points (|today|, |yesterday|, |two_days_ago|), no matter
what time they actually represent. I addressed this in
https://codereview.chromium.org/1389923004/

https://codereview.chromium.org/1370493002/diff/40001/components/history/core...
components/history/core/browser/visit_database_unittest.cc:429: Time
two_days_ago = (yesterday - TimeDelta::FromHours(36)).LocalMidnight();
On 2015/10/01 17:01:48, lwchkg wrote:
> A similar mistake is found here. So effectively you have two_days_ago and
> four_days_ago.

Done.

Powered by Google App Engine
This is Rietveld 408576698