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

Issue 2638923002: Device policy refresh fixed when the device is woken up. (Closed)

Created:
3 years, 11 months ago by igorcov
Modified:
3 years, 9 months ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Device policy refresh fixed when the device is woken up. When the device wakes up, check and reschedule, if the policy refresh should happen earlier based on system time. BUG=665343 TEST=Manually tested on lulu device. Review-Url: https://codereview.chromium.org/2638923002 Cr-Commit-Position: refs/heads/master@{#453207} Committed: https://chromium.googlesource.com/chromium/src/+/5d10b590e88508313c9e68d004cabc11bf6f55ce

Patch Set 1 #

Total comments: 4

Patch Set 2 : Implemented RefreshAfter to combine system time and TimeTicks #

Patch Set 3 : Comments fixed #

Total comments: 10

Patch Set 4 : Fixed review comments #

Patch Set 5 : Nit #

Patch Set 6 : Implemented better accuracy #

Patch Set 7 : Nit #

Patch Set 8 : Nit #

Total comments: 16

Patch Set 9 : Fixed review comments #

Patch Set 10 : Fixed review comments #

Total comments: 2

Patch Set 11 : Nits #

Patch Set 12 : Unit test fix #

Patch Set 13 : Fixed the tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -49 lines) Patch
M components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +12 lines, -2 lines 0 comments Download
M components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc View 1 2 3 4 5 6 7 8 9 10 9 chunks +46 lines, -8 lines 0 comments Download
M components/policy/core/common/cloud/cloud_policy_refresh_scheduler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 14 chunks +43 lines, -39 lines 0 comments Download

Messages

Total messages: 53 (25 generated)
igorcov
Please take a look.
3 years, 10 months ago (2017-01-31 08:54:30 UTC) #3
Andrew T Wilson (Slow)
LGTM as a workaround, but I feel like we need to keep investigating the true ...
3 years, 10 months ago (2017-01-31 09:29:26 UTC) #4
igorcov
https://codereview.chromium.org/2638923002/diff/1/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc File components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc (right): https://codereview.chromium.org/2638923002/diff/1/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc#newcode185 components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc:185: RefreshSoon(); On 2017/01/31 09:29:26, Andrew T Wilson (Slow) wrote: ...
3 years, 10 months ago (2017-01-31 09:40:07 UTC) #5
Andrew T Wilson (Slow)
On 2017/01/31 09:40:07, igorcov wrote: > https://codereview.chromium.org/2638923002/diff/1/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc > File components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc > (right): > > https://codereview.chromium.org/2638923002/diff/1/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc#newcode185 ...
3 years, 10 months ago (2017-01-31 10:19:06 UTC) #6
igorcov
On 2017/01/31 10:19:06, Andrew T Wilson (Slow) wrote: > On 2017/01/31 09:40:07, igorcov wrote: > ...
3 years, 10 months ago (2017-01-31 12:09:38 UTC) #7
Andrew T Wilson (Slow)
On 2017/01/31 12:09:38, igorcov wrote: > On 2017/01/31 10:19:06, Andrew T Wilson (Slow) wrote: > ...
3 years, 10 months ago (2017-01-31 13:47:57 UTC) #8
igorcov
On 2017/01/31 13:47:57, Andrew T Wilson (Slow) wrote: > On 2017/01/31 12:09:38, igorcov wrote: > ...
3 years, 10 months ago (2017-01-31 14:42:13 UTC) #9
Andrew T Wilson (Slow)
On 2017/01/31 14:42:13, igorcov wrote: > On 2017/01/31 13:47:57, Andrew T Wilson (Slow) wrote: > ...
3 years, 10 months ago (2017-01-31 15:20:28 UTC) #10
Thiemo Nagel
https://codereview.chromium.org/2638923002/diff/1/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc File components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc (right): https://codereview.chromium.org/2638923002/diff/1/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc#newcode181 components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc:181: base::TimeDelta delta = last_refresh_ Please convert last_refresh_ (and creation_time_) ...
3 years, 10 months ago (2017-02-01 13:14:02 UTC) #11
igorcov
On 2017/02/01 13:14:02, Thiemo Nagel (slow) wrote: > https://codereview.chromium.org/2638923002/diff/1/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc > File components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc > (right): > ...
3 years, 10 months ago (2017-02-08 15:30:52 UTC) #12
Thiemo Nagel
> Since TimeTicks doesn't count the time spent while sleeping (as discovered > in other ...
3 years, 10 months ago (2017-02-13 16:20:05 UTC) #13
igorcov
Answering in line: > > True. However using Time leads to missing policy fetches when ...
3 years, 10 months ago (2017-02-15 12:42:43 UTC) #14
Thiemo Nagel
> I don't think we need the wake-up notification. There's no need to fetch the ...
3 years, 10 months ago (2017-02-15 17:42:41 UTC) #15
igorcov
Good point Thiemo, I've included the last_refresh variable in TimeTicks to combine them when deciding ...
3 years, 10 months ago (2017-02-16 17:11:20 UTC) #16
Thiemo Nagel
Maybe (if you want) it would make sense to create a class (e.g. "SaneTime") that ...
3 years, 10 months ago (2017-02-17 14:28:23 UTC) #17
igorcov
I don't see much value in having a separate SaneTime class. I think the right ...
3 years, 10 months ago (2017-02-20 13:16:59 UTC) #25
igorcov
Implemented better accuracy according to Drew's idea. Please take a look.
3 years, 10 months ago (2017-02-20 15:15:45 UTC) #26
Andrew T Wilson (Slow)
https://codereview.chromium.org/2638923002/diff/140001/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc File components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc (right): https://codereview.chromium.org/2638923002/diff/140001/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc#newcode153 components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc:153: last_refresh_ = base::Time::NowFromSystemTime(); Let's just create an "UpdateLastRefresh()" helper ...
3 years, 10 months ago (2017-02-20 15:39:01 UTC) #27
Andrew T Wilson (Slow)
Also, any way for us to add any test cases for this? Possibly difficult, because ...
3 years, 10 months ago (2017-02-20 15:48:48 UTC) #28
igorcov
Yes, I tried to look if any unit tests can be added, but it seems ...
3 years, 10 months ago (2017-02-20 16:12:13 UTC) #29
Andrew T Wilson (Slow)
https://codereview.chromium.org/2638923002/diff/140001/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc File components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc (right): https://codereview.chromium.org/2638923002/diff/140001/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc#newcode188 components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc:188: if (last_refresh_.is_null()) On 2017/02/20 16:12:12, igorcov wrote: > On ...
3 years, 10 months ago (2017-02-20 16:35:43 UTC) #30
igorcov
https://codereview.chromium.org/2638923002/diff/140001/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc File components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc (right): https://codereview.chromium.org/2638923002/diff/140001/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc#newcode188 components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc:188: if (last_refresh_.is_null()) On 2017/02/20 16:35:43, Andrew T Wilson (Slow) ...
3 years, 10 months ago (2017-02-21 13:10:24 UTC) #31
Andrew T Wilson (Slow)
lgtm https://codereview.chromium.org/2638923002/diff/180001/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc File components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc (right): https://codereview.chromium.org/2638923002/diff/180001/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc#newcode188 components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc:188: // the next refresh should happend based on ...
3 years, 10 months ago (2017-02-22 15:44:03 UTC) #33
Thiemo Nagel
Lgtm w/ nit https://codereview.chromium.org/2638923002/diff/180001/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h File components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h (right): https://codereview.chromium.org/2638923002/diff/180001/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h#newcode134 components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h:134: // TODO(igorcov): crbug.com/665343. Reduce this to ...
3 years, 10 months ago (2017-02-22 16:08:22 UTC) #34
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/2638923002/200001
3 years, 10 months ago (2017-02-24 09:02:05 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/372903)
3 years, 10 months ago (2017-02-24 09:38:36 UTC) #39
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/2638923002/240001
3 years, 9 months ago (2017-02-27 14:20:46 UTC) #50
commit-bot: I haz the power
3 years, 9 months ago (2017-02-27 14:25:56 UTC) #53
Message was sent while issue was closed.
Committed patchset #13 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/5d10b590e88508313c9e68d004ca...

Powered by Google App Engine
This is Rietveld 408576698