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

Issue 1282013004: BackgroundSyncManager tracks client registrations (Closed)

Created:
5 years, 4 months ago by jkarlin
Modified:
5 years, 3 months ago
CC:
chromium-reviews, tim+watch_chromium.org, viettrungluu+watch_chromium.org, qsr+mojo_chromium.org, zea+watch_chromium.org, Aaron Boodman, maxbogue+watch_chromium.org, jam, yzshen+watch_chromium.org, abarth-chromium, pvalenzuela+watch_chromium.org, plaree+watch_chromium.org, jkarlin+watch_chromium.org, darin-cc_chromium.org, darin (slow to review), ben+mojo_chromium.org, maniscalco+watch_chromium.org, Ken Rockot(use gerrit already)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

For the upcoming "registration.done" feature the BackgroundSyncManager's clients will want to know about the state of registrations even after the BackgroundSyncManager has finished firing them. To prepare for that, this CL does the following: 1) BackgroundSyncManager now internally reference counts each registration it exposes to the client via RefCountedRegistration so that the client can reference a completed registration 2) BackgroundSyncManager returns BackgroundSyncRegistrationHandle to clients, which call BackgroundSyncManager::ReleaseRegistrationHandle when deleted (ensuring that all client-exposed registrations are released). 3) BackgroundSyncServiceImpl holds onto Client registrations until the renderer has signaled that it is done with them. 4) Moved Unregister to the new BackgroundSyncRegistrationHandle class (a la the javascript API). This makes it clear when it's safe for the client to delete its ClientBackgroundSyncRegisration (when it no longer needs to call unregister). 5) Added a few tests, and removed redundant sync browser tests from the service_workerbrowser_tests that are now covered in background_sync_browsertests.cc Patch 1 [Blink]: https://codereview.chromium.org/1279323002/ Patch 2 [Browser]: this Patch 3 [Blink cleanup]: https://codereview.chromium.org/1285653002/ BUG=502214 Committed: https://crrev.com/14977394017e56a86c5516e3c4b3f8988a2031f5 Cr-Commit-Position: refs/heads/master@{#348303}

Patch Set 1 #

Patch Set 2 : nits #

Patch Set 3 : Manager returns scoped_ptr, dcheck all registrations deleted #

Patch Set 4 : ClientBackgroundSyncRegistration refactor #

Patch Set 5 : Extract some browsertest changes for another CL #

Patch Set 6 : Cleanup #

Patch Set 7 : Rebase #

Patch Set 8 : Rebase #

Patch Set 9 : Rebase #

Patch Set 10 : Android fix #

Total comments: 33

Patch Set 11 : Rebase #

Patch Set 12 : Address comments from PS10 #

Total comments: 4

Patch Set 13 : Address comments from PS12 #

Total comments: 22

Patch Set 14 : Address some comments from PS13 #

Patch Set 15 : Rebase #

Patch Set 16 : Refactor ClientBackgroundSyncRegistration to BackgroundSyncRegistrationHandle #

Patch Set 17 : Clean up #

Total comments: 40

Patch Set 18 : Rebase and address comments from PS17 #

Total comments: 4

Patch Set 19 : Rebase #

Patch Set 20 : Order of operations fix for Windows #

Patch Set 21 : Rebase #

Total comments: 40

Patch Set 22 : Rebase #

Patch Set 23 : Address comments from PS21 #

Patch Set 24 : Rebase #

Patch Set 25 : Rebase #

Patch Set 26 : nits #

Total comments: 2

Patch Set 27 : Rebase #

Patch Set 28 : Removed test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+931 lines, -724 lines) Patch
M content/browser/background_sync/background_sync_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 5 chunks +48 lines, -2 lines 0 comments Download
M content/browser/background_sync/background_sync_context_impl.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/background_sync/background_sync_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 13 chunks +74 lines, -37 lines 0 comments Download
M content/browser/background_sync/background_sync_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 39 chunks +272 lines, -156 lines 0 comments Download
M content/browser/background_sync/background_sync_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 27 chunks +97 lines, -106 lines 0 comments Download
M content/browser/background_sync/background_sync_registration.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +6 lines, -0 lines 0 comments Download
M content/browser/background_sync/background_sync_registration.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +0 lines, -72 lines 0 comments Download
A content/browser/background_sync/background_sync_registration_handle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +80 lines, -0 lines 0 comments Download
A content/browser/background_sync/background_sync_registration_handle.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +44 lines, -0 lines 0 comments Download
M content/browser/background_sync/background_sync_service_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +13 lines, -7 lines 0 comments Download
M content/browser/background_sync/background_sync_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 6 chunks +73 lines, -12 lines 0 comments Download
M content/browser/background_sync/background_sync_service_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +8 lines, -5 lines 0 comments Download
M content/browser/service_worker/service_worker_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 5 chunks +0 lines, -249 lines 0 comments Download
M content/browser/service_worker/service_worker_version.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 3 chunks +6 lines, -5 lines 0 comments Download
M content/child/background_sync/background_sync_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +11 lines, -1 line 0 comments Download
M content/child/background_sync/background_sync_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 chunks +14 lines, -2 lines 0 comments Download
M content/child/background_sync/background_sync_provider_thread_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +9 lines, -0 lines 0 comments Download
M content/child/background_sync/background_sync_provider_thread_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +36 lines, -0 lines 0 comments Download
M content/child/background_sync/background_sync_type_converters.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +2 lines, -2 lines 0 comments Download
M content/child/background_sync/background_sync_type_converters_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +5 lines, -5 lines 0 comments Download
M content/common/background_sync_service.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -2 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +2 lines, -0 lines 0 comments Download
M content/public/common/background_sync.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/background_sync/background_sync_client_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +8 lines, -3 lines 0 comments Download
M content/renderer/background_sync/background_sync_client_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +41 lines, -5 lines 0 comments Download
M content/renderer/service_worker/service_worker_context_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +9 lines, -2 lines 0 comments Download
M content/test/data/background_sync/background_sync_test_helpers.js View 1 2 3 1 chunk +39 lines, -0 lines 0 comments Download
M content/test/data/background_sync/service_worker.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +24 lines, -0 lines 0 comments Download
D content/test/data/background_sync/sync_event_interface.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -13 lines 0 comments Download
D content/test/data/background_sync/sync_event_rejected.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -16 lines 0 comments Download
D content/test/data/service_worker/sync.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -20 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 48 (13 generated)
jkarlin
iclelland: PTAL, sorry about the large CL!
5 years, 4 months ago (2015-08-13 12:01:01 UTC) #2
jkarlin
PTAL, many thanks!
5 years, 4 months ago (2015-08-14 11:47:19 UTC) #3
iclelland
That was a big one ;) My only real concern is the tight coordination required ...
5 years, 4 months ago (2015-08-14 14:44:19 UTC) #4
jkarlin
Thanks Ian, PTAL. -- snip -- My only real concern is the tight coordination required ...
5 years, 4 months ago (2015-08-17 17:14:50 UTC) #7
jkarlin
Forgot to check this one off. https://codereview.chromium.org/1282013004/diff/170001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (left): https://codereview.chromium.org/1282013004/diff/170001/content/browser/background_sync/background_sync_manager.cc#oldcode102 content/browser/background_sync/background_sync_manager.cc:102: void BackgroundSyncManager::Unregister( On ...
5 years, 4 months ago (2015-08-17 17:18:15 UTC) #8
iclelland
Awesome! LGTM, with just a couple of nits in comments. https://codereview.chromium.org/1282013004/diff/170001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1282013004/diff/170001/content/browser/background_sync/background_sync_manager.cc#newcode59 ...
5 years, 4 months ago (2015-08-17 19:22:02 UTC) #11
jkarlin
michaeln: PTAL at everything for committer approval. Thank you! https://codereview.chromium.org/1282013004/diff/290001/content/browser/background_sync/background_sync_manager.h File content/browser/background_sync/background_sync_manager.h (right): https://codereview.chromium.org/1282013004/diff/290001/content/browser/background_sync/background_sync_manager.h#newcode170 content/browser/background_sync/background_sync_manager.h:170: ...
5 years, 4 months ago (2015-08-18 15:12:38 UTC) #13
michaeln
I'm not sure the lifetime management stuff really works? I'm also not sure any of ...
5 years, 4 months ago (2015-08-19 01:56:01 UTC) #14
jkarlin
Thanks Michael, PTAL at my responses. https://codereview.chromium.org/1282013004/diff/310001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1282013004/diff/310001/content/browser/background_sync/background_sync_manager.cc#newcode631 content/browser/background_sync/background_sync_manager.cc:631: sync_registration->id = client_registration_ids_.Add(ptr); ...
5 years, 4 months ago (2015-08-19 12:47:06 UTC) #15
jkarlin
https://codereview.chromium.org/1282013004/diff/310001/content/browser/background_sync/client_background_sync_registration.h File content/browser/background_sync/client_background_sync_registration.h (right): https://codereview.chromium.org/1282013004/diff/310001/content/browser/background_sync/client_background_sync_registration.h#newcode22 content/browser/background_sync/client_background_sync_registration.h:22: : public BackgroundSyncRegistration { On 2015/08/19 12:47:06, jkarlin wrote: ...
5 years, 4 months ago (2015-08-19 17:24:22 UTC) #16
michaeln
On 2015/08/19 17:24:22, jkarlin wrote: > https://codereview.chromium.org/1282013004/diff/310001/content/browser/background_sync/client_background_sync_registration.h > File content/browser/background_sync/client_background_sync_registration.h > (right): > > https://codereview.chromium.org/1282013004/diff/310001/content/browser/background_sync/client_background_sync_registration.h#newcode22 ...
5 years, 4 months ago (2015-08-19 18:59:35 UTC) #17
jkarlin
On 2015/08/19 18:59:35, michaeln wrote: > On 2015/08/19 17:24:22, jkarlin wrote: > > > https://codereview.chromium.org/1282013004/diff/310001/content/browser/background_sync/client_background_sync_registration.h ...
5 years, 4 months ago (2015-08-20 17:08:18 UTC) #18
michaeln
cc'ing ken for thoughts about relative msg ordering (see the "Bah... also, I'm noticing" comment) ...
5 years, 4 months ago (2015-08-21 02:39:25 UTC) #19
jkarlin
*phew*. PTAL Michael. Thanks. https://codereview.chromium.org/1282013004/diff/390001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1282013004/diff/390001/content/browser/background_sync/background_sync_manager.cc#newcode383 content/browser/background_sync/background_sync_manager.cc:383: scoped_refptr<RefCountedRegistration> new_ref_registration( On 2015/08/21 02:39:24, ...
5 years, 4 months ago (2015-08-25 17:32:59 UTC) #21
jkarlin
https://codereview.chromium.org/1282013004/diff/430001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1282013004/diff/430001/content/browser/background_sync/background_sync_manager.cc#newcode980 content/browser/background_sync/background_sync_manager.cc:980: registration_handle->handle_id(), registration_handle is passed later in this call, need ...
5 years, 3 months ago (2015-08-25 21:31:46 UTC) #22
jkarlin
PTAL michaeln, sorry that it has become so monstrous :\ https://codereview.chromium.org/1282013004/diff/430001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1282013004/diff/430001/content/browser/background_sync/background_sync_manager.cc#newcode980 ...
5 years, 3 months ago (2015-08-26 14:22:51 UTC) #23
jkarlin
tsepez@chromium.org: Please review changes in the mojom file. Thanks!
5 years, 3 months ago (2015-08-27 17:39:07 UTC) #25
michaeln
Sorry for being slow to reply. I'm still looking for how to best utilize mojo ...
5 years, 3 months ago (2015-08-28 02:53:12 UTC) #26
iclelland
https://codereview.chromium.org/1282013004/diff/490001/content/child/background_sync/background_sync_provider_thread_proxy.h File content/child/background_sync/background_sync_provider_thread_proxy.h (right): https://codereview.chromium.org/1282013004/diff/490001/content/child/background_sync/background_sync_provider_thread_proxy.h#newcode28 content/child/background_sync/background_sync_provider_thread_proxy.h:28: class BackgroundSyncProviderThreadProxy : public blink::WebSyncProvider, On 2015/08/28 02:53:11, michaeln ...
5 years, 3 months ago (2015-08-28 12:55:22 UTC) #27
Tom Sepez
mojom LGTM
5 years, 3 months ago (2015-08-31 18:30:56 UTC) #28
Tom Sepez
mojom LGTM
5 years, 3 months ago (2015-08-31 18:30:56 UTC) #29
jkarlin
Back from vacation. Thanks for your comments Michael. PTAL! https://codereview.chromium.org/1282013004/diff/490001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1282013004/diff/490001/content/browser/background_sync/background_sync_manager.cc#newcode35 content/browser/background_sync/background_sync_manager.cc:35: ...
5 years, 3 months ago (2015-09-02 23:51:41 UTC) #31
jkarlin
https://codereview.chromium.org/1282013004/diff/490001/content/renderer/service_worker/service_worker_context_client.cc File content/renderer/service_worker/service_worker_context_client.cc (right): https://codereview.chromium.org/1282013004/diff/490001/content/renderer/service_worker/service_worker_context_client.cc#newcode358 content/renderer/service_worker/service_worker_context_client.cc:358: provider_context_->GetRegistrationInfoAndVersionAttributes(&registration_info, On 2015/09/02 23:51:41, jkarlin wrote: > On 2015/08/28 ...
5 years, 3 months ago (2015-09-03 14:21:02 UTC) #34
jkarlin
michaeln, I think we're almost there, PTAL! Thank you.
5 years, 3 months ago (2015-09-03 21:11:32 UTC) #35
jkarlin
Ping michaeln?
5 years, 3 months ago (2015-09-08 19:03:14 UTC) #36
jkarlin
On 2015/09/08 19:03:14, jkarlin wrote: > Ping michaeln? Note that I still have to deal ...
5 years, 3 months ago (2015-09-08 20:57:49 UTC) #37
jkarlin
On 2015/09/08 20:57:49, jkarlin wrote: > On 2015/09/08 19:03:14, jkarlin wrote: > > Ping michaeln? ...
5 years, 3 months ago (2015-09-08 21:06:13 UTC) #38
michaeln
lgtm, kinda, its a bunch of complexity that doesn't quite fit together right yet? I ...
5 years, 3 months ago (2015-09-10 21:21:34 UTC) #39
jkarlin
https://codereview.chromium.org/1282013004/diff/630001/content/renderer/background_sync/background_sync_client_impl.cc File content/renderer/background_sync/background_sync_client_impl.cc (right): https://codereview.chromium.org/1282013004/diff/630001/content/renderer/background_sync/background_sync_client_impl.cc#newcode45 content/renderer/background_sync/background_sync_client_impl.cc:45: // TODO(jkarlin): Find a way to claim the handle ...
5 years, 3 months ago (2015-09-10 23:26:01 UTC) #40
jkarlin
On 2015/09/10 21:21:34, michaeln wrote: > lgtm, kinda, its a bunch of complexity that doesn't ...
5 years, 3 months ago (2015-09-10 23:31:14 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1282013004/670001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1282013004/670001
5 years, 3 months ago (2015-09-11 00:06:19 UTC) #44
commit-bot: I haz the power
Committed patchset #28 (id:670001)
5 years, 3 months ago (2015-09-11 00:52:10 UTC) #45
commit-bot: I haz the power
Patchset 28 (id:??) landed as https://crrev.com/14977394017e56a86c5516e3c4b3f8988a2031f5 Cr-Commit-Position: refs/heads/master@{#348303}
5 years, 3 months ago (2015-09-11 00:52:59 UTC) #46
jkarlin
On 2015/09/10 21:21:34, michaeln wrote: > lgtm, kinda, its a bunch of complexity that doesn't ...
5 years, 3 months ago (2015-09-11 11:04:59 UTC) #47
commit-bot: I haz the power
5 years, 3 months ago (2015-09-23 12:17:12 UTC) #48
Message was sent while issue was closed.
Patchset 28 (id:??) landed as
https://crrev.com/14977394017e56a86c5516e3c4b3f8988a2031f5
Cr-Commit-Position: refs/heads/master@{#348303}

Powered by Google App Engine
This is Rietveld 408576698