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

Issue 1704293002: ServiceWorker: Stop asynchronously creating response accessors to fix crash due to null context (Closed)

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

Description

ServiceWorker: Stop asynchronously creating response accessors to fix crash due to null context Before this CL, ServiceWorkerResponseReader and ServiceWorkerResponseWriter were asynchronously created in ServiceWorkerCacheWriter. Unfortunately, the cache writer did not check the validity of ServiceWorkerContextCore before attempting to create the accessors, so it caused crashes when the context was already gone due to storage failure etc. This CL stops asynchronously creating those response accessors, and creates them when ServiceWorkerCacheWriter is constructed so that the cache writer no longer has to concern about the validity of the context. If the context is gone after the accessors are created, diskcache acceess simply fails[1]. [1] https://codereview.chromium.org/1693303002/ BUG=584606 Committed: https://crrev.com/67f195ef19365fce612b2d84799a2c7b26c2df96 Cr-Commit-Position: refs/heads/master@{#376113}

Patch Set 1 : #

Total comments: 4

Patch Set 2 : fix impl comment #

Patch Set 3 : fix win bots #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -47 lines) Patch
M content/browser/service_worker/service_worker_cache_writer.h View 1 2 chunks +5 lines, -16 lines 0 comments Download
M content/browser/service_worker/service_worker_cache_writer.cc View 5 chunks +12 lines, -14 lines 0 comments Download
M content/browser/service_worker/service_worker_cache_writer_unittest.cc View 1 2 21 chunks +31 lines, -11 lines 0 comments Download
M content/browser/service_worker/service_worker_write_to_cache_job.cc View 1 chunk +2 lines, -6 lines 0 comments Download

Messages

Total messages: 21 (13 generated)
nhiroki
falken@, can you review this? Thanks! https://codereview.chromium.org/1704293002/diff/20001/content/browser/service_worker/service_worker_cache_writer.h File content/browser/service_worker/service_worker_cache_writer.h (left): https://codereview.chromium.org/1704293002/diff/20001/content/browser/service_worker/service_worker_cache_writer.h#oldcode49 content/browser/service_worker/service_worker_cache_writer.h:49: // multiple readers ...
4 years, 10 months ago (2016-02-18 04:21:53 UTC) #10
falken
lgtm, nice fix. This is yet another WeakPtr dereference crash... I sometimes think we should ...
4 years, 10 months ago (2016-02-18 04:43:59 UTC) #11
nhiroki
Thank you for reviewing! https://codereview.chromium.org/1704293002/diff/20001/content/browser/service_worker/service_worker_cache_writer.h File content/browser/service_worker/service_worker_cache_writer.h (right): https://codereview.chromium.org/1704293002/diff/20001/content/browser/service_worker/service_worker_cache_writer.h#newcode44 content/browser/service_worker/service_worker_cache_writer.h:44: // The existing reader may ...
4 years, 10 months ago (2016-02-18 07:09:48 UTC) #13
nhiroki
On 2016/02/18 04:43:59, falken wrote: > lgtm, nice fix. > > This is yet another ...
4 years, 10 months ago (2016-02-18 07:15:40 UTC) #14
nhiroki
On 2016/02/18 07:15:40, nhiroki wrote: > On 2016/02/18 04:43:59, falken wrote: > > lgtm, nice ...
4 years, 10 months ago (2016-02-18 07:17:07 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1704293002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1704293002/80001
4 years, 10 months ago (2016-02-18 07:17:39 UTC) #18
commit-bot: I haz the power
Committed patchset #3 (id:80001)
4 years, 10 months ago (2016-02-18 07:23:49 UTC) #19
commit-bot: I haz the power
4 years, 10 months ago (2016-02-18 07:25:01 UTC) #21
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/67f195ef19365fce612b2d84799a2c7b26c2df96
Cr-Commit-Position: refs/heads/master@{#376113}

Powered by Google App Engine
This is Rietveld 408576698