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

Issue 461233004: Fix crash in ServiceWorkerRegistrationHandle (Closed)

Created:
6 years, 4 months ago by falken
Modified:
6 years, 4 months ago
Reviewers:
nhiroki
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, kinuko+serviceworker, darin-cc_chromium.org, horo+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

Fix crash in ServiceWorkerRegistrationHandle Before this patch, when register() fails to install a worker, it would result in ServiceWorkerRegistrationHandle::OnRegisterFailed nulling out its reference to the registration in order to allow the registration to die. This was flawed for two reasons: - When the handle is destructed, it would dereference the null pointer. - SWRegistrationHandle is responsible for listening for ref count changes from Blink-side about the corresponding JavaScript ServiceWorkerRegistration object. It's a weird state for Handle to forget about the Chromium-side registration while Blink-side is alive. The Chromium-side Registration lifetime should be tied to Blink's. BUG=384119, 396400 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=289597

Patch Set 1 #

Patch Set 2 : comment fix #

Total comments: 2

Patch Set 3 : add DCHECK #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -3 lines) Patch
M content/browser/service_worker/service_worker_registration_handle.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/service_worker_registration_handle.cc View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_registration_unittest.cc View 1 2 chunks +21 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
falken
WDYT? The alternative is to clear registration_ on Failed() like we already do, and just ...
6 years, 4 months ago (2014-08-14 08:07:03 UTC) #1
nhiroki
Thank you for working on this. LGTM. On 2014/08/14 08:07:03, falken wrote: > WDYT? The ...
6 years, 4 months ago (2014-08-14 08:38:47 UTC) #2
nhiroki
https://codereview.chromium.org/461233004/diff/20001/content/browser/service_worker/service_worker_registration_handle.cc File content/browser/service_worker/service_worker_registration_handle.cc (right): https://codereview.chromium.org/461233004/diff/20001/content/browser/service_worker/service_worker_registration_handle.cc#newcode35 content/browser/service_worker/service_worker_registration_handle.cc:35: ServiceWorkerRegistrationHandle::~ServiceWorkerRegistrationHandle() { Can we have DCHECK for |registration_| here?
6 years, 4 months ago (2014-08-14 08:39:08 UTC) #3
falken
Thanks! https://codereview.chromium.org/461233004/diff/20001/content/browser/service_worker/service_worker_registration_handle.cc File content/browser/service_worker/service_worker_registration_handle.cc (right): https://codereview.chromium.org/461233004/diff/20001/content/browser/service_worker/service_worker_registration_handle.cc#newcode35 content/browser/service_worker/service_worker_registration_handle.cc:35: ServiceWorkerRegistrationHandle::~ServiceWorkerRegistrationHandle() { On 2014/08/14 08:39:07, nhiroki wrote: > ...
6 years, 4 months ago (2014-08-14 09:07:21 UTC) #4
falken
The CQ bit was checked by falken@chromium.org
6 years, 4 months ago (2014-08-14 09:08:00 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/falken@chromium.org/461233004/40001
6 years, 4 months ago (2014-08-14 09:10:28 UTC) #6
commit-bot: I haz the power
6 years, 4 months ago (2014-08-14 15:31:32 UTC) #7
Message was sent while issue was closed.
Committed patchset #3 (40001) as 289597

Powered by Google App Engine
This is Rietveld 408576698