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

Issue 1048053002: [BackgroundSync] Handle storage failure (Closed)

Created:
5 years, 8 months ago by jkarlin
Modified:
5 years, 8 months ago
Reviewers:
michaeln, jsbell
CC:
chromium-reviews, tim+watch_chromium.org, zea+watch_chromium.org, maxbogue+watch_chromium.org, jam, pvalenzuela+watch_chromium.org, darin-cc_chromium.org, plaree+watch_chromium.org, maniscalco+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@background_sync
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[BackgroundSync] Handle storage failure This CL introduces proper failure handling in case the storage backend fails. Changes: 1. If the ServiceWorker is unregistered - Remove the sync registrations from memory 2. If the ServiceWorkerStorage is wiped - Reinit the BackgroundSyncManager 3. If reading or writing from ServiceWorkerStorage fails (SERVICE_WORKER_ERROR_FAILURE) - Delete everything and disable the BackgroundSyncManager until browser restart. Added unittests for above cases. I had to change the unittest to register serviceworkers via the ServiceWorkerContext instead of directly in Storage so that the ServiceWorkerContextObserver receives updates. BUG=449443 Committed: https://crrev.com/9059304cb5c6f7f683ea30259eeacc5a429566c9 Cr-Commit-Position: refs/heads/master@{#323756}

Patch Set 1 #

Patch Set 2 : More tests #

Patch Set 3 : Rebase #

Patch Set 4 : Rebase #

Total comments: 16

Patch Set 5 : Address comments from PS4 #

Total comments: 6

Patch Set 6 : Address comments from PS5 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+483 lines, -172 lines) Patch
M content/browser/background_sync/background_sync_manager.h View 1 2 3 4 8 chunks +39 lines, -6 lines 0 comments Download
M content/browser/background_sync/background_sync_manager.cc View 1 2 3 4 13 chunks +200 lines, -36 lines 0 comments Download
M content/browser/background_sync/background_sync_manager_unittest.cc View 1 2 3 4 5 17 chunks +199 lines, -92 lines 0 comments Download
M content/browser/cache_storage/cache_storage_scheduler.h View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/cache_storage/cache_storage_scheduler.cc View 1 2 3 4 2 chunks +4 lines, -1 line 0 comments Download
M content/browser/cache_storage/cache_storage_scheduler_unittest.cc View 1 2 3 4 5 2 chunks +33 lines, -37 lines 0 comments Download

Messages

Total messages: 23 (6 generated)
jkarlin
jsbell: PTAL at everything. In particular, is this the right way to handle errors from ...
5 years, 8 months ago (2015-03-31 15:39:11 UTC) #3
jsbell
On 2015/03/31 15:39:11, jkarlin wrote: > In particular, is this the right way to handle ...
5 years, 8 months ago (2015-03-31 16:33:13 UTC) #4
jkarlin
On 2015/03/31 16:33:13, jsbell wrote: > On 2015/03/31 15:39:11, jkarlin wrote: > > In particular, ...
5 years, 8 months ago (2015-03-31 16:37:41 UTC) #5
jsbell
On 2015/03/31 16:37:41, jkarlin wrote: > Bah, sorry. My eyes burned in on the word ...
5 years, 8 months ago (2015-03-31 16:41:53 UTC) #6
jkarlin
On 2015/03/31 16:41:53, jsbell wrote: > On 2015/03/31 16:37:41, jkarlin wrote: > > Bah, sorry. ...
5 years, 8 months ago (2015-03-31 16:44:48 UTC) #8
jkarlin
jsbell and michaeln, PTAL. Thanks!
5 years, 8 months ago (2015-04-01 17:15:54 UTC) #10
michaeln
https://codereview.chromium.org/1048053002/diff/100001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1048053002/diff/100001/content/browser/background_sync/background_sync_manager.cc#newcode293 content/browser/background_sync/background_sync_manager.cc:293: DCHECK(disabled_); Can BackgroundSyncManager::OnStorageWipedImpl happen while the op to run ...
5 years, 8 months ago (2015-04-01 21:37:31 UTC) #11
jsbell
https://codereview.chromium.org/1048053002/diff/100001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1048053002/diff/100001/content/browser/background_sync/background_sync_manager.cc#newcode128 content/browser/background_sync/background_sync_manager.cc:128: base::Closure pending_callback = Can you add a comment that ...
5 years, 8 months ago (2015-04-01 21:54:54 UTC) #12
jkarlin
Thanks! https://codereview.chromium.org/1048053002/diff/100001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1048053002/diff/100001/content/browser/background_sync/background_sync_manager.cc#newcode128 content/browser/background_sync/background_sync_manager.cc:128: base::Closure pending_callback = On 2015/04/01 21:54:54, jsbell wrote: ...
5 years, 8 months ago (2015-04-02 17:57:56 UTC) #13
jsbell
https://codereview.chromium.org/1048053002/diff/100001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1048053002/diff/100001/content/browser/background_sync/background_sync_manager.cc#newcode291 content/browser/background_sync/background_sync_manager.cc:291: void BackgroundSyncManager::DisableAndClearManagerImpl( On 2015/04/02 17:57:56, jkarlin wrote: > On ...
5 years, 8 months ago (2015-04-02 20:25:13 UTC) #14
michaeln
lgtm (modulo green tests)
5 years, 8 months ago (2015-04-02 23:06:11 UTC) #15
michaeln
https://codereview.chromium.org/1048053002/diff/100001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1048053002/diff/100001/content/browser/background_sync/background_sync_manager.cc#newcode128 content/browser/background_sync/background_sync_manager.cc:128: base::Closure pending_callback = On 2015/04/02 17:57:56, jkarlin wrote: > ...
5 years, 8 months ago (2015-04-02 23:06:20 UTC) #16
jkarlin
Thanks! https://codereview.chromium.org/1048053002/diff/120001/content/browser/background_sync/background_sync_manager_unittest.cc File content/browser/background_sync/background_sync_manager_unittest.cc (right): https://codereview.chromium.org/1048053002/diff/120001/content/browser/background_sync/background_sync_manager_unittest.cc#newcode546 content/browser/background_sync/background_sync_manager_unittest.cc:546: bool register_called = false; On 2015/04/02 23:06:20, michaeln ...
5 years, 8 months ago (2015-04-03 15:15:04 UTC) #17
jsbell
lgtm!
5 years, 8 months ago (2015-04-03 16:38:03 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1048053002/140001
5 years, 8 months ago (2015-04-03 16:43:16 UTC) #21
commit-bot: I haz the power
Committed patchset #6 (id:140001)
5 years, 8 months ago (2015-04-03 16:47:07 UTC) #22
commit-bot: I haz the power
5 years, 8 months ago (2015-04-03 20:38:21 UTC) #23
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/9059304cb5c6f7f683ea30259eeacc5a429566c9
Cr-Commit-Position: refs/heads/master@{#323756}

Powered by Google App Engine
This is Rietveld 408576698