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

Issue 2066593003: Add a general purpose facility for letting background tasks wait until (Closed)

Created:
4 years, 6 months ago by Pete Williamson
Modified:
4 years, 6 months ago
CC:
chromium-reviews, romax+watch_chromium.org, fgorski+watch_chromium.org, dewittj+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, dimich+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a general purpose facility for letting background tasks wait until the task is done before returning control to GCM Network Manager. To minimize concurrent network activity, the background offlining task wants to make sure we hold the thread for the GCM Network Manager until we are done using the network instead of letting the task start right away. The idea here is to reduce network contention during the Marshmallow maintenance window when the network becomes available. While this is only needed for BackgroundOfflining at the moment, we wanted to make the feature more generally accessible, any task with a bundle containing "WaitNeeded" set to anything other than 0 will start a wait. BUG=612325 patch from issue 1985923002 at patchset 200001 (http://crrev.com/1985923002#ps200001) Committed: https://crrev.com/71ef97e9c3815152a269b37b67990a7bbd641e1c Cr-Commit-Position: refs/heads/master@{#400180}

Patch Set 1 #

Total comments: 28

Patch Set 2 : CR feedback per DougArnett #

Total comments: 14

Patch Set 3 : CR feedback per BauerB #

Patch Set 4 : rebase #

Total comments: 4

Patch Set 5 : CR fixes per BauerB (round 2) #

Total comments: 4

Patch Set 6 : Last CR feedback from BauerB #

Patch Set 7 : merge fix #

Patch Set 8 : merge fix #

Patch Set 9 : logical merge fix #

Messages

Total messages: 46 (18 generated)
Pete Williamson
4 years, 6 months ago (2016-06-13 20:41:23 UTC) #2
dougarnett
To help various consumers and maintainers of ChromeBackgroundService, we may need to document more about ...
4 years, 6 months ago (2016-06-13 21:53:35 UTC) #3
Pete Williamson
Added a lot more doc, PTAL and let me know if you think I should ...
4 years, 6 months ago (2016-06-13 23:23:11 UTC) #4
dougarnett
Added doc looks really helpful. Want to try to get Bernard looped in on the ...
4 years, 6 months ago (2016-06-14 01:42:46 UTC) #5
Pete Williamson
BauerB: Please review changes to ChromeBackgroundService and the new interface for waiters. Thanks! (I'll address ...
4 years, 6 months ago (2016-06-14 02:15:19 UTC) #7
dougarnett
https://codereview.chromium.org/2066593003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java (right): https://codereview.chromium.org/2066593003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java#newcode170 chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java:170: private void setWaitLatchIfNeeded(Bundle bundle) { For testing, maybe make ...
4 years, 6 months ago (2016-06-14 16:01:20 UTC) #8
Bernhard Bauer
https://codereview.chromium.org/2066593003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java (right): https://codereview.chromium.org/2066593003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java#newcode92 chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java:92: // If needed, block the GcmNetworkManager thread until the ...
4 years, 6 months ago (2016-06-14 16:07:32 UTC) #9
Pete Williamson
Addressed feedback from BauerB and DougArnett https://codereview.chromium.org/2066593003/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java (right): https://codereview.chromium.org/2066593003/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java#newcode160 chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java:160: if (bundle != ...
4 years, 6 months ago (2016-06-15 00:25:20 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2066593003/40001
4 years, 6 months ago (2016-06-15 00:25:53 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2066593003/60001
4 years, 6 months ago (2016-06-15 00:47:20 UTC) #14
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/228552)
4 years, 6 months ago (2016-06-15 01:02:43 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2066593003/60001
4 years, 6 months ago (2016-06-15 15:06:39 UTC) #18
Bernhard Bauer
https://codereview.chromium.org/2066593003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java (right): https://codereview.chromium.org/2066593003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java#newcode21 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java:21: bundle.putLong(ChromeBackgroundService.HOLD_WAKELOCK, 1); On 2016/06/15 00:25:19, Pete Williamson wrote: > ...
4 years, 6 months ago (2016-06-15 15:24:29 UTC) #19
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-15 15:38:39 UTC) #21
Pete Williamson
https://codereview.chromium.org/2066593003/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java (right): https://codereview.chromium.org/2066593003/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java#newcode51 chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java:51: private CountDownLatch mLatch; On 2016/06/15 15:24:29, Bernhard Bauer wrote: ...
4 years, 6 months ago (2016-06-15 15:55:50 UTC) #22
dougarnett
lgtm - with recommendation to drop waitForTaskIfNeeded() method https://codereview.chromium.org/2066593003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java (right): https://codereview.chromium.org/2066593003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java#newcode187 chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java:187: public ...
4 years, 6 months ago (2016-06-15 16:22:35 UTC) #23
Bernhard Bauer
lgtm https://codereview.chromium.org/2066593003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundServiceWaiter.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundServiceWaiter.java (right): https://codereview.chromium.org/2066593003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundServiceWaiter.java#newcode48 chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundServiceWaiter.java:48: if (mLatch != null) { This check is ...
4 years, 6 months ago (2016-06-15 16:32:45 UTC) #24
Pete Williamson
https://codereview.chromium.org/2066593003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java (right): https://codereview.chromium.org/2066593003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java#newcode187 chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java:187: public void waitForTaskIfNeeded(ChromeBackgroundServiceWaiter waiter) { On 2016/06/15 16:22:35, dougarnett ...
4 years, 6 months ago (2016-06-16 00:29:58 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2066593003/100001
4 years, 6 months ago (2016-06-16 00:30:52 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/21738) mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, ...
4 years, 6 months ago (2016-06-16 00:34:17 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2066593003/140001
4 years, 6 months ago (2016-06-16 00:45:08 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_chromium_compile_only_ng/builds/153671) chromeos_x86-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, ...
4 years, 6 months ago (2016-06-16 00:54:41 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2066593003/160001
4 years, 6 months ago (2016-06-16 01:07:24 UTC) #38
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_rel/builds/128086)
4 years, 6 months ago (2016-06-16 02:34:56 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2066593003/160001
4 years, 6 months ago (2016-06-16 16:51:41 UTC) #42
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 6 months ago (2016-06-16 17:12:38 UTC) #43
commit-bot: I haz the power
CQ bit was unchecked
4 years, 6 months ago (2016-06-16 17:12:41 UTC) #44
commit-bot: I haz the power
4 years, 6 months ago (2016-06-16 17:14:07 UTC) #46
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/71ef97e9c3815152a269b37b67990a7bbd641e1c
Cr-Commit-Position: refs/heads/master@{#400180}

Powered by Google App Engine
This is Rietveld 408576698