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

Issue 1525743002: Allow ServiceWorker events to have custom durations (Closed)

Created:
5 years ago by jkarlin
Modified:
5 years ago
CC:
blink-worker-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, horo+watch_chromium.org, jam, jkarlin+watch_chromium.org, jsbell+serviceworker_chromium.org, kinuko+watch, kinuko+serviceworker, maxbogue+watch_chromium.org, michaeln, nhiroki, plaree+watch_chromium.org, pvalenzuela+watch_chromium.org, serviceworker-reviews, tim+watch_chromium.org, tzik, zea+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow ServiceWorker events to have custom durations BackgroundSync events need to be able to run for a different amount of time than other events, such as push or fetch. This CL allows each event request to set its own expiration time and stores them in a priority queue based on increasing expiration time. It adds some tests to the ServiceWorkerVersion changes and lets BackgroundSync set its own custom time (by default 3 minutes but field trails will be able to change it in an upcoming CL). This CL also adds the ability for selected types of requests to not stop the service worker if they time out. Right now this only pertains to the sync event. BUG=569001 Committed: https://crrev.com/264567afb2a2b59a2f155d50463d94476cbef6bf Cr-Commit-Position: refs/heads/master@{#366105}

Patch Set 1 #

Patch Set 2 : Tests #

Patch Set 3 : Rebase #

Patch Set 4 : Nits #

Patch Set 5 : Mock background_sync_dispatcher_ #

Patch Set 6 : Comments #

Total comments: 7

Patch Set 7 : Keep running if bgsync fails, but not other requests #

Patch Set 8 : Logic bug #

Total comments: 8

Patch Set 9 : Address comments from PS8 #

Total comments: 7

Patch Set 10 : Address comments from PS9 #

Patch Set 11 : Use std::move instead of .Pass #

Messages

Total messages: 32 (16 generated)
jkarlin
falken: PTAL at everything, thanks!
5 years ago (2015-12-16 18:50:22 UTC) #3
Marijn Kruisselbrink
just some drive-by comments https://codereview.chromium.org/1525743002/diff/100001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1525743002/diff/100001/content/browser/service_worker/service_worker_version.cc#newcode2150 content/browser/service_worker/service_worker_version.cc:2150: if (requests_.empty() && request_timed_out && ...
5 years ago (2015-12-16 19:09:57 UTC) #5
jkarlin
https://codereview.chromium.org/1525743002/diff/100001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1525743002/diff/100001/content/browser/service_worker/service_worker_version.cc#newcode2150 content/browser/service_worker/service_worker_version.cc:2150: if (requests_.empty() && request_timed_out && running_status() != STOPPING) On ...
5 years ago (2015-12-16 19:29:56 UTC) #6
jkarlin
Thanks for the drive by mek :) https://codereview.chromium.org/1525743002/diff/100001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1525743002/diff/100001/content/browser/service_worker/service_worker_version.cc#newcode2150 content/browser/service_worker/service_worker_version.cc:2150: if (requests_.empty() ...
5 years ago (2015-12-16 20:44:27 UTC) #9
jkarlin
falken@: PTAL, thanks!
5 years ago (2015-12-17 12:22:52 UTC) #11
falken
Sorry for the late review, I was off today. This is looking good, just some ...
5 years ago (2015-12-17 13:54:33 UTC) #12
jkarlin
falken@: Sorry, didn't mean for you to look on your day off! PTAL when you ...
5 years ago (2015-12-17 15:01:54 UTC) #14
jkarlin
isherman@: PTAL at histograms.xml, thanks!
5 years ago (2015-12-17 15:23:17 UTC) #16
Ilya Sherman
histograms lgtm w/ a nit: https://codereview.chromium.org/1525743002/diff/220001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1525743002/diff/220001/tools/metrics/histograms/histograms.xml#newcode43044 tools/metrics/histograms/histograms.xml:43044: +<histogram name="ServiceWorker.BackgroundSyncEvent.Time" units="milliseconds"> nit: ...
5 years ago (2015-12-17 21:41:37 UTC) #17
falken
lgtm https://codereview.chromium.org/1525743002/diff/220001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1525743002/diff/220001/content/browser/service_worker/service_worker_version.cc#newcode2332 content/browser/service_worker/service_worker_version.cc:2332: case NUM_REQUEST_TYPES: nit: NUM_REQUEST_TYPES being passed is a ...
5 years ago (2015-12-18 01:28:48 UTC) #18
jkarlin
Thanks everyone! https://codereview.chromium.org/1525743002/diff/220001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1525743002/diff/220001/content/browser/service_worker/service_worker_version.cc#newcode2332 content/browser/service_worker/service_worker_version.cc:2332: case NUM_REQUEST_TYPES: On 2015/12/18 01:28:47, falken wrote: ...
5 years ago (2015-12-18 12:28:30 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1525743002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1525743002/240001
5 years ago (2015-12-18 13:03:08 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/130416)
5 years ago (2015-12-18 13:11:06 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1525743002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1525743002/260001
5 years ago (2015-12-18 13:18:03 UTC) #28
commit-bot: I haz the power
Committed patchset #11 (id:260001)
5 years ago (2015-12-18 16:20:05 UTC) #30
commit-bot: I haz the power
5 years ago (2015-12-18 16:21:18 UTC) #32
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/264567afb2a2b59a2f155d50463d94476cbef6bf
Cr-Commit-Position: refs/heads/master@{#366105}

Powered by Google App Engine
This is Rietveld 408576698