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

Issue 641943002: components: Introduce AlarmTimer class and use it for GCM heartbeat (Closed)

Created:
6 years, 2 months ago by Chirantan Ekbote
Modified:
6 years, 2 months ago
CC:
chromium-reviews, Eric Caruso, erikwright+watch_chromium.org, fgorski, Sameer Nanda
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

components: Introduce AlarmTimer class and use it for GCM heartbeat This adds the AlarmTimer class to components, which is capable of waking up the system from suspend on platforms that support this operation (currently only Chrome OS with linux version 3.11 or higher). On all other platforms, the AlarmTimer behaves exactly the same as a regular Timer. BUG=crosbug.com/p/32272 Committed: https://crrev.com/26436e402e6e1b780f6565539ae0acb3e2976fb9 Cr-Commit-Position: refs/heads/master@{#301175}

Patch Set 1 #

Patch Set 2 : Add gcm bits #

Patch Set 3 : Make some Timer variables protected to reduce duplication, clean up comments #

Total comments: 24

Patch Set 4 : Address comments #

Patch Set 5 : Move the code over to components/ #

Total comments: 6

Patch Set 6 : Fix DEPS issue #

Patch Set 7 : Fix gyp files #

Total comments: 28

Patch Set 8 : Address comments #

Total comments: 8

Patch Set 9 : Fix nits #

Patch Set 10 : Fix build error in mcs_probe #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1108 lines, -34 lines) Patch
M base/timer/timer.h View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M components/OWNERS View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M components/components.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M components/gcm_driver.gypi View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M components/gcm_driver/DEPS View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M components/gcm_driver/gcm_client_impl.cc View 1 2 3 4 5 6 7 2 chunks +12 lines, -6 lines 0 comments Download
M components/gcm_driver/gcm_client_impl_unittest.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -1 line 0 comments Download
A + components/timers.gypi View 1 2 3 4 5 6 7 1 chunk +10 lines, -7 lines 0 comments Download
A + components/timers/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +6 lines, -4 lines 0 comments Download
A components/timers/DEPS View 1 2 3 4 5 6 7 1 chunk +10 lines, -0 lines 0 comments Download
A components/timers/OWNERS View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
A components/timers/README View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
A components/timers/alarm_timer.h View 1 2 3 4 5 6 7 1 chunk +103 lines, -0 lines 0 comments Download
A components/timers/alarm_timer.cc View 1 2 3 4 5 6 7 1 chunk +127 lines, -0 lines 0 comments Download
A components/timers/alarm_timer_unittest.cc View 1 2 3 4 5 6 7 1 chunk +496 lines, -0 lines 0 comments Download
A components/timers/rtc_alarm.h View 1 2 3 4 5 6 7 1 chunk +95 lines, -0 lines 0 comments Download
A components/timers/rtc_alarm.cc View 1 2 3 4 5 6 7 1 chunk +182 lines, -0 lines 0 comments Download
M google_apis/gcm/engine/heartbeat_manager.h View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -3 lines 0 comments Download
M google_apis/gcm/engine/heartbeat_manager.cc View 1 2 3 4 5 6 7 8 5 chunks +8 lines, -8 lines 0 comments Download
M google_apis/gcm/engine/heartbeat_manager_unittest.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -1 line 0 comments Download
M google_apis/gcm/engine/mcs_client.h View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -1 line 0 comments Download
M google_apis/gcm/engine/mcs_client.cc View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -1 line 0 comments Download
M google_apis/gcm/engine/mcs_client_unittest.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -1 line 0 comments Download
M google_apis/gcm/tools/mcs_probe.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -1 line 0 comments Download

Messages

Total messages: 60 (11 generated)
Chirantan Ekbote
Hi Darin, Apologies for the noise but I wasn't sure who was the right person ...
6 years, 2 months ago (2014-10-09 01:36:18 UTC) #2
darin (slow to review)
Why does this make sense as a feature of base/? Who are the intended consumers?
6 years, 2 months ago (2014-10-09 03:41:36 UTC) #3
Chirantan Ekbote
On 2014/10/09 03:41:36, darin wrote: > Why does this make sense as a feature of ...
6 years, 2 months ago (2014-10-09 04:01:42 UTC) #4
Nicolas Zea
Agree that this isn't necessarily appropriate for base/. I think it might make more sense ...
6 years, 2 months ago (2014-10-09 04:01:43 UTC) #5
Chirantan Ekbote
On 2014/10/09 04:01:43, Nicolas Zea wrote: > Agree that this isn't necessarily appropriate for base/. ...
6 years, 2 months ago (2014-10-09 18:12:17 UTC) #6
Chirantan Ekbote
Hi Brett, Please take a look at this CL as owner of base/. While the ...
6 years, 2 months ago (2014-10-14 21:41:51 UTC) #8
Chirantan Ekbote
Sigh... I just noticed that Brett doesn't appear to be an owner of base/ anymore. ...
6 years, 2 months ago (2014-10-14 21:47:27 UTC) #10
Lei Zhang
So shill and powerd are both CrOS projects that use chromeos's libbase right? What are ...
6 years, 2 months ago (2014-10-15 00:03:09 UTC) #11
Chirantan Ekbote
On 2014/10/15 00:03:09, Lei Zhang wrote: > So shill and powerd are both CrOS projects ...
6 years, 2 months ago (2014-10-15 01:40:56 UTC) #12
Lei Zhang
Let's get another opinion from derat@, who has more chrome + chromeos experience.
6 years, 2 months ago (2014-10-15 06:36:12 UTC) #13
Daniel Erat
On 2014/10/15 06:36:12, Lei Zhang wrote: > Let's get another opinion from derat@, who has ...
6 years, 2 months ago (2014-10-15 15:03:51 UTC) #14
Daniel Erat
https://codereview.chromium.org/641943002/diff/50001/base/base.gypi File base/base.gypi (right): https://codereview.chromium.org/641943002/diff/50001/base/base.gypi#newcode667 base/base.gypi:667: 'timer/rtc_alarm_chromeos.cc', nit: fix alphabetization https://codereview.chromium.org/641943002/diff/50001/base/timer/alarm_timer.cc File base/timer/alarm_timer.cc (right): https://codereview.chromium.org/641943002/diff/50001/base/timer/alarm_timer.cc#newcode62 ...
6 years, 2 months ago (2014-10-15 15:04:22 UTC) #16
Nicolas Zea
do the message pump implementations themselves need to be modified to wake up? Its not ...
6 years, 2 months ago (2014-10-15 18:00:52 UTC) #17
Lei Zhang
On 2014/10/15 15:03:51, Daniel Erat wrote: > On 2014/10/15 06:36:12, Lei Zhang wrote: > > ...
6 years, 2 months ago (2014-10-15 18:41:00 UTC) #18
Daniel Erat
On 2014/10/15 18:41:00, Lei Zhang wrote: > On 2014/10/15 15:03:51, Daniel Erat wrote: > > ...
6 years, 2 months ago (2014-10-15 20:11:01 UTC) #19
Chirantan Ekbote
ptal. When I removed the timer.h include from heartbeat_manager.h and forward declared it instead, I ...
6 years, 2 months ago (2014-10-16 21:26:39 UTC) #20
Lei Zhang
On 2014/10/15 20:11:01, Daniel Erat wrote: > On 2014/10/15 18:41:00, Lei Zhang wrote: > > ...
6 years, 2 months ago (2014-10-16 21:38:36 UTC) #21
Chirantan Ekbote
On 2014/10/15 18:00:52, Nicolas Zea wrote: > do the message pump implementations themselves need to ...
6 years, 2 months ago (2014-10-16 21:49:55 UTC) #22
Chirantan Ekbote
On 2014/10/16 21:38:36, Lei Zhang wrote: > On 2014/10/15 20:11:01, Daniel Erat wrote: > > ...
6 years, 2 months ago (2014-10-16 21:54:48 UTC) #23
Nicolas Zea
On 2014/10/16 21:49:55, chirantan wrote: > On 2014/10/15 18:00:52, Nicolas Zea wrote: > > do ...
6 years, 2 months ago (2014-10-16 21:59:13 UTC) #24
Chirantan Ekbote
On 2014/10/16 21:59:13, Nicolas Zea wrote: > On 2014/10/16 21:49:55, chirantan wrote: > > On ...
6 years, 2 months ago (2014-10-16 22:23:35 UTC) #25
Daniel Erat
one highish-level question: do you think that there will be implementations of this class for ...
6 years, 2 months ago (2014-10-16 23:25:44 UTC) #26
Nicolas Zea
On 2014/10/16 22:23:35, chirantan wrote: > On 2014/10/16 21:59:13, Nicolas Zea wrote: > > On ...
6 years, 2 months ago (2014-10-16 23:34:15 UTC) #27
Chirantan Ekbote
On 2014/10/16 23:34:15, Nicolas Zea wrote: > > Are you sure you're looking at the ...
6 years, 2 months ago (2014-10-17 02:13:54 UTC) #28
Nicolas Zea
On 2014/10/17 02:13:54, chirantan wrote: > On 2014/10/16 23:34:15, Nicolas Zea wrote: > > > ...
6 years, 2 months ago (2014-10-17 21:36:33 UTC) #29
Chirantan Ekbote
ptal
6 years, 2 months ago (2014-10-20 22:19:06 UTC) #31
blundell
The dependencies here are wrong unfortunately; I wasn't aware (but should have asked) what code ...
6 years, 2 months ago (2014-10-21 05:53:25 UTC) #33
Nicolas Zea
HeartbeatManager is owned by google_apis/gcm/mcs_client.h, which is instantiated by components/gcm_driver/gcm_client_impl.h, which I believe should be ...
6 years, 2 months ago (2014-10-21 17:57:54 UTC) #34
Chirantan Ekbote
Please take another look. https://codereview.chromium.org/641943002/diff/340001/google_apis/gcm/DEPS File google_apis/gcm/DEPS (right): https://codereview.chromium.org/641943002/diff/340001/google_apis/gcm/DEPS#newcode13 google_apis/gcm/DEPS:13: "+components/timer", # For AlarmTimer class ...
6 years, 2 months ago (2014-10-21 21:13:48 UTC) #35
Lei Zhang
Chirantan, do you want to also own the new component you are adding? Is "timer" ...
6 years, 2 months ago (2014-10-21 22:34:12 UTC) #36
Chirantan Ekbote
On 2014/10/21 22:34:12, Lei Zhang wrote: > Chirantan, do you want to also own the ...
6 years, 2 months ago (2014-10-21 22:51:43 UTC) #37
Chirantan Ekbote
https://codereview.chromium.org/641943002/diff/380001/base/timer/timer.h File base/timer/timer.h (right): https://codereview.chromium.org/641943002/diff/380001/base/timer/timer.h#newcode135 base/timer/timer.h:135: const bool is_repeating_; On 2014/10/21 22:34:11, Lei Zhang wrote: ...
6 years, 2 months ago (2014-10-21 22:52:21 UTC) #38
blundell
//components LGTM, but I didn't look at the code under //components/timer so please get derat's ...
6 years, 2 months ago (2014-10-22 13:46:24 UTC) #39
Nicolas Zea
https://codereview.chromium.org/641943002/diff/380001/google_apis/gcm/engine/heartbeat_manager.h File google_apis/gcm/engine/heartbeat_manager.h (right): https://codereview.chromium.org/641943002/diff/380001/google_apis/gcm/engine/heartbeat_manager.h#newcode57 google_apis/gcm/engine/heartbeat_manager.h:57: void SetHeartbeatTimer(scoped_ptr<base::Timer> timer); Why not just pass it in ...
6 years, 2 months ago (2014-10-22 17:32:16 UTC) #40
Chirantan Ekbote
https://codereview.chromium.org/641943002/diff/380001/base/timer/timer.h File base/timer/timer.h (right): https://codereview.chromium.org/641943002/diff/380001/base/timer/timer.h#newcode141 base/timer/timer.h:141: bool is_running_; On 2014/10/22 13:46:24, blundell wrote: > To ...
6 years, 2 months ago (2014-10-22 18:47:14 UTC) #41
Daniel Erat
lgtm for components/timer https://codereview.chromium.org/641943002/diff/380001/components/timer/alarm_timer.cc File components/timer/alarm_timer.cc (right): https://codereview.chromium.org/641943002/diff/380001/components/timer/alarm_timer.cc#newcode82 components/timer/alarm_timer.cc:82: if (delay_ == base::TimeDelta()) { On ...
6 years, 2 months ago (2014-10-23 03:44:54 UTC) #42
blundell
https://codereview.chromium.org/641943002/diff/380001/base/timer/timer.h File base/timer/timer.h (right): https://codereview.chromium.org/641943002/diff/380001/base/timer/timer.h#newcode141 base/timer/timer.h:141: bool is_running_; On 2014/10/22 18:47:14, chirantan wrote: > On ...
6 years, 2 months ago (2014-10-23 05:54:20 UTC) #43
Nicolas Zea
https://codereview.chromium.org/641943002/diff/380001/google_apis/gcm/engine/heartbeat_manager.h File google_apis/gcm/engine/heartbeat_manager.h (right): https://codereview.chromium.org/641943002/diff/380001/google_apis/gcm/engine/heartbeat_manager.h#newcode57 google_apis/gcm/engine/heartbeat_manager.h:57: void SetHeartbeatTimer(scoped_ptr<base::Timer> timer); On 2014/10/22 18:47:14, chirantan wrote: > ...
6 years, 2 months ago (2014-10-23 17:49:03 UTC) #44
Chirantan Ekbote
Please take another look. https://codereview.chromium.org/641943002/diff/380001/base/timer/timer.h File base/timer/timer.h (right): https://codereview.chromium.org/641943002/diff/380001/base/timer/timer.h#newcode141 base/timer/timer.h:141: bool is_running_; On 2014/10/23 05:54:20, ...
6 years, 2 months ago (2014-10-23 23:53:30 UTC) #45
Nicolas Zea
gcm LGTM! Thanks for cleaning that up https://codereview.chromium.org/641943002/diff/400001/components/gcm_driver/DEPS File components/gcm_driver/DEPS (right): https://codereview.chromium.org/641943002/diff/400001/components/gcm_driver/DEPS#newcode4 components/gcm_driver/DEPS:4: "+components/timers", nit: ...
6 years, 2 months ago (2014-10-24 00:28:19 UTC) #46
Lei Zhang
base/ lgtm with some nits. https://codereview.chromium.org/641943002/diff/400001/base/timer/timer.h File base/timer/timer.h (right): https://codereview.chromium.org/641943002/diff/400001/base/timer/timer.h#newcode118 base/timer/timer.h:118: const tracked_objects::Location& posted_from() { ...
6 years, 2 months ago (2014-10-24 00:44:50 UTC) #47
Chirantan Ekbote
Thanks for the reviews! https://codereview.chromium.org/641943002/diff/400001/base/timer/timer.h File base/timer/timer.h (right): https://codereview.chromium.org/641943002/diff/400001/base/timer/timer.h#newcode118 base/timer/timer.h:118: const tracked_objects::Location& posted_from() { return ...
6 years, 2 months ago (2014-10-24 01:04:13 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/641943002/420001
6 years, 2 months ago (2014-10-24 01:08:57 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_rel/builds/27591) linux_chromium_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel/builds/2556)
6 years, 2 months ago (2014-10-24 01:29:47 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/641943002/440001
6 years, 2 months ago (2014-10-24 01:48:12 UTC) #54
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel/builds/5863) linux_chromium_chromeos_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel/builds/4646) linux_chromium_gn_dbg ...
6 years, 2 months ago (2014-10-24 02:09:10 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/641943002/440001
6 years, 2 months ago (2014-10-24 18:29:43 UTC) #58
commit-bot: I haz the power
Committed patchset #10 (id:440001)
6 years, 2 months ago (2014-10-24 19:44:57 UTC) #59
commit-bot: I haz the power
6 years, 2 months ago (2014-10-24 19:45:38 UTC) #60
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/26436e402e6e1b780f6565539ae0acb3e2976fb9
Cr-Commit-Position: refs/heads/master@{#301175}

Powered by Google App Engine
This is Rietveld 408576698