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

Issue 745123002: Link GCM heartbeat with wake on wifi preference (Closed)

Created:
6 years, 1 month ago by Chirantan Ekbote
Modified:
6 years ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, nkostylev+watch_chromium.org, zea+watch_chromium.org, oshima+watch_chromium.org, erikwright+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, Sameer Nanda
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Link GCM heartbeat with wake on wifi preference Currently, the GCM heartbeat manager schedules a timer that will always wake up the system from suspend in order to send a heartbeat message. This is bad for battery life if the user doesn't actually want to use the wake on packet feature. To deal with this problem: - Add a new function, SetWakeFromSuspend, to the AlarmTimer class so that its wake from suspend ability can be changed on the fly. - Drill a hole through GCM's beautiful abstraction layers so that we can get to the HeartbeatManager via the GCMDriver interface. - Hook up the endpoint in the GCMDriver interface to WakeOnWifiManager::OnPreferenceChanged so that the wake from suspend property for all the GCM heartbeat timers is changed along with shill's settings. BUG=397328, chrome-os-partner:34142 Committed: https://crrev.com/192a92175999160848b161f09b5c4a798e39d82c Cr-Commit-Position: refs/heads/master@{#307151}

Patch Set 1 #

Patch Set 2 : Add gcm_started_callback_ to prevent a crash #

Total comments: 8

Patch Set 3 : Make GCM wake from suspend aware #

Total comments: 10

Patch Set 4 : address comments #

Patch Set 5 : Clean up includes #

Total comments: 2

Patch Set 6 : Remove timer from MCSClient constructor #

Patch Set 7 : Only call WakeFromSuspendForHeartbeat if enabled #

Patch Set 8 : Fix missing include #

Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -61 lines) Patch
M chrome/browser/chromeos/net/wake_on_wifi_manager.h View 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/net/wake_on_wifi_manager.cc View 1 2 5 chunks +31 lines, -2 lines 0 comments Download
M components/gcm_driver/fake_gcm_client.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M components/gcm_driver/fake_gcm_client.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -0 lines 0 comments Download
M components/gcm_driver/fake_gcm_driver.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/gcm_driver/fake_gcm_driver.cc View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M components/gcm_driver/gcm_client.h View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M components/gcm_driver/gcm_client_impl.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M components/gcm_driver/gcm_client_impl.cc View 1 2 3 4 5 3 chunks +7 lines, -11 lines 0 comments Download
M components/gcm_driver/gcm_client_impl_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M components/gcm_driver/gcm_driver.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M components/gcm_driver/gcm_driver_android.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/gcm_driver/gcm_driver_android.cc View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M components/gcm_driver/gcm_driver_desktop.h View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M components/gcm_driver/gcm_driver_desktop.cc View 1 2 3 4 5 6 7 chunks +48 lines, -1 line 0 comments Download
M components/timers/alarm_timer.h View 1 2 2 chunks +5 lines, -5 lines 0 comments Download
M components/timers/alarm_timer.cc View 1 2 2 chunks +21 lines, -21 lines 0 comments Download
M components/timers/rtc_alarm.cc View 1 chunk +5 lines, -1 line 0 comments Download
M google_apis/gcm/engine/heartbeat_manager.h View 1 2 3 4 5 2 chunks +4 lines, -1 line 0 comments Download
M google_apis/gcm/engine/heartbeat_manager.cc View 1 2 3 4 5 3 chunks +18 lines, -2 lines 0 comments Download
M google_apis/gcm/engine/heartbeat_manager_unittest.cc View 1 2 3 4 5 3 chunks +22 lines, -4 lines 0 comments Download
M google_apis/gcm/engine/mcs_client.h View 1 2 3 4 5 2 chunks +4 lines, -2 lines 0 comments Download
M google_apis/gcm/engine/mcs_client.cc View 1 2 3 4 5 3 chunks +5 lines, -3 lines 0 comments Download
M google_apis/gcm/engine/mcs_client_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M google_apis/gcm/tools/mcs_probe.cc View 1 2 3 4 5 2 chunks +1 line, -4 lines 0 comments Download

Messages

Total messages: 28 (4 generated)
Chirantan Ekbote
Please take a look. Lei: Please review base/ Dan: Please review timers/ Steven: Please review ...
6 years, 1 month ago (2014-11-21 03:27:35 UTC) #2
Daniel Erat
https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.h File components/timers/alarm_timer.h (right): https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.h#newcode70 components/timers/alarm_timer.h:70: void SetWakeFromSuspend(bool wake_from_suspend); when you set this to false ...
6 years ago (2014-11-21 14:46:49 UTC) #3
Chirantan Ekbote
https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.h File components/timers/alarm_timer.h (right): https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.h#newcode70 components/timers/alarm_timer.h:70: void SetWakeFromSuspend(bool wake_from_suspend); On 2014/11/21 14:46:49, Daniel Erat wrote: ...
6 years ago (2014-11-21 18:09:51 UTC) #4
Daniel Erat
https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.cc File components/timers/alarm_timer.cc (right): https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.cc#newcode45 components/timers/alarm_timer.cc:45: // If the timer's current wake from suspend setting ...
6 years ago (2014-11-21 22:25:18 UTC) #5
Chirantan Ekbote
https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.h File components/timers/alarm_timer.h (right): https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.h#newcode70 components/timers/alarm_timer.h:70: void SetWakeFromSuspend(bool wake_from_suspend); On 2014/11/21 22:25:18, Daniel Erat wrote: ...
6 years ago (2014-11-24 23:28:35 UTC) #6
Nicolas Zea
https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.h File components/timers/alarm_timer.h (right): https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.h#newcode70 components/timers/alarm_timer.h:70: void SetWakeFromSuspend(bool wake_from_suspend); On 2014/11/24 23:28:35, chirantan wrote: > ...
6 years ago (2014-12-03 21:12:38 UTC) #7
Chirantan Ekbote
https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.h File components/timers/alarm_timer.h (right): https://codereview.chromium.org/745123002/diff/20001/components/timers/alarm_timer.h#newcode70 components/timers/alarm_timer.h:70: void SetWakeFromSuspend(bool wake_from_suspend); On 2014/12/03 21:12:38, Nicolas Zea wrote: ...
6 years ago (2014-12-03 22:59:18 UTC) #8
Nicolas Zea
I see. Okay, I misunderstood then. I was under the impression that AlarmTimer had or ...
6 years ago (2014-12-03 23:10:21 UTC) #9
Chirantan Ekbote
On 2014/12/03 23:10:21, Nicolas Zea wrote: > I see. Okay, I misunderstood then. I was ...
6 years ago (2014-12-03 23:32:20 UTC) #10
Chirantan Ekbote
This patch set moves the wake from suspend stuff out of the AlarmTimer and into ...
6 years ago (2014-12-04 23:11:25 UTC) #11
Daniel Erat
lgtm for the now-minimal non-gcm bits. :-) as a side note, i think that something ...
6 years ago (2014-12-04 23:23:16 UTC) #12
Chirantan Ekbote
I do have a nickname set but I noticed the reply@chromiumcodereview... thing started happening after ...
6 years ago (2014-12-04 23:31:40 UTC) #13
Nicolas Zea
https://codereview.chromium.org/745123002/diff/40001/components/gcm_driver/gcm_client.h File components/gcm_driver/gcm_client.h (right): https://codereview.chromium.org/745123002/diff/40001/components/gcm_driver/gcm_client.h#newcode306 components/gcm_driver/gcm_client.h:306: virtual MCSClient* GetMCSClient() const = 0; I'm not a ...
6 years ago (2014-12-05 00:53:05 UTC) #14
Chirantan Ekbote
ptal https://codereview.chromium.org/745123002/diff/40001/components/gcm_driver/gcm_client.h File components/gcm_driver/gcm_client.h (right): https://codereview.chromium.org/745123002/diff/40001/components/gcm_driver/gcm_client.h#newcode306 components/gcm_driver/gcm_client.h:306: virtual MCSClient* GetMCSClient() const = 0; On 2014/12/05 ...
6 years ago (2014-12-05 21:49:05 UTC) #15
Nicolas Zea
LGTM with a question. Thanks for working this out! https://codereview.chromium.org/745123002/diff/80001/components/gcm_driver/gcm_driver_desktop.cc File components/gcm_driver/gcm_driver_desktop.cc (right): https://codereview.chromium.org/745123002/diff/80001/components/gcm_driver/gcm_driver_desktop.cc#newcode762 components/gcm_driver/gcm_driver_desktop.cc:762: ...
6 years ago (2014-12-05 22:28:11 UTC) #16
Chirantan Ekbote
https://codereview.chromium.org/745123002/diff/80001/components/gcm_driver/gcm_driver_desktop.cc File components/gcm_driver/gcm_driver_desktop.cc (right): https://codereview.chromium.org/745123002/diff/80001/components/gcm_driver/gcm_driver_desktop.cc#newcode762 components/gcm_driver/gcm_driver_desktop.cc:762: WakeFromSuspendForHeartbeat(wake_from_suspend_enabled_); On 2014/12/05 22:28:11, Nicolas Zea wrote: > nit: ...
6 years ago (2014-12-05 22:38:46 UTC) #17
Nicolas Zea
On 2014/12/05 22:38:46, chirantan wrote: > https://codereview.chromium.org/745123002/diff/80001/components/gcm_driver/gcm_driver_desktop.cc > File components/gcm_driver/gcm_driver_desktop.cc (right): > > https://codereview.chromium.org/745123002/diff/80001/components/gcm_driver/gcm_driver_desktop.cc#newcode762 > ...
6 years ago (2014-12-05 22:59:58 UTC) #18
Chirantan Ekbote
On 2014/12/05 22:59:58, Nicolas Zea wrote: > On 2014/12/05 22:38:46, chirantan wrote: > > > ...
6 years ago (2014-12-05 23:12:54 UTC) #19
Nicolas Zea
Nice, LGTM!
6 years ago (2014-12-05 23:14:52 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/745123002/120001
6 years ago (2014-12-05 23:15:50 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/6710)
6 years ago (2014-12-06 00:10:16 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/745123002/140001
6 years ago (2014-12-06 02:23:55 UTC) #26
commit-bot: I haz the power
Committed patchset #8 (id:140001)
6 years ago (2014-12-06 03:30:54 UTC) #27
commit-bot: I haz the power
6 years ago (2014-12-06 03:31:48 UTC) #28
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/192a92175999160848b161f09b5c4a798e39d82c
Cr-Commit-Position: refs/heads/master@{#307151}

Powered by Google App Engine
This is Rietveld 408576698