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

Issue 640923003: [ServiceWorker] Handle bytes_read=0 async result correctly in ServiceWorkerWriteToCacheJob. (Closed)

Created:
6 years, 2 months ago by horo
Modified:
6 years, 2 months ago
Reviewers:
michaeln
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, kinuko+serviceworker, nhiroki, darin-cc_chromium.org, horo+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

[ServiceWorker] Handle bytes_read=0 async result correctly in ServiceWorkerWriteToCacheJob. The async result of net_request_->Read() in ServiceWorkerWriteToCacheJob::ReadNetData() is passed to ServiceWorkerWriteToCacheJob::OnReadCompleted(). In current code the case when bytes_read is 0 is not handled correctly. So when bytes_read is 0 the script loading will hang. LayoutTest is here: https://codereview.chromium.org/650193003 I hope this patch will reduce the test flakiness :) BUG=419999 TEST=http/tests/serviceworker/chromium/load-flushed-script.html Committed: https://crrev.com/a67ddd2ace106615b22015f34ae9117a8e44699d Cr-Commit-Position: refs/heads/master@{#300233}

Patch Set 1 #

Total comments: 7

Patch Set 2 : incorporated michaeln's comment #

Total comments: 4

Patch Set 3 : add DCHECK and remove retrurn #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -8 lines) Patch
M content/browser/service_worker/service_worker_write_to_cache_job.cc View 1 2 2 chunks +11 lines, -8 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
horo
michaeln@ Could you please review this?
6 years, 2 months ago (2014-10-16 07:52:57 UTC) #2
michaeln
thanx for characterizing and fixing this bug! https://codereview.chromium.org/640923003/diff/1/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc (right): https://codereview.chromium.org/640923003/diff/1/content/browser/service_worker/service_worker_write_to_cache_job.cc#newcode374 content/browser/service_worker/service_worker_write_to_cache_job.cc:374: NotifyReadComplete(0); I ...
6 years, 2 months ago (2014-10-16 23:37:12 UTC) #3
michaeln
https://codereview.chromium.org/640923003/diff/1/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc (right): https://codereview.chromium.org/640923003/diff/1/content/browser/service_worker/service_worker_write_to_cache_job.cc#newcode374 content/browser/service_worker/service_worker_write_to_cache_job.cc:374: NotifyReadComplete(0); > I think we need to do the ...
6 years, 2 months ago (2014-10-17 00:07:31 UTC) #4
horo
https://codereview.chromium.org/640923003/diff/1/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc (right): https://codereview.chromium.org/640923003/diff/1/content/browser/service_worker/service_worker_write_to_cache_job.cc#newcode374 content/browser/service_worker/service_worker_write_to_cache_job.cc:374: NotifyReadComplete(0); On 2014/10/17 00:07:31, michaeln wrote: > > I ...
6 years, 2 months ago (2014-10-17 02:39:12 UTC) #5
michaeln
lgtm, thnx! https://codereview.chromium.org/640923003/diff/20001/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc (right): https://codereview.chromium.org/640923003/diff/20001/content/browser/service_worker/service_worker_write_to_cache_job.cc#newcode373 content/browser/service_worker/service_worker_write_to_cache_job.cc:373: // No more data to process, the ...
6 years, 2 months ago (2014-10-17 19:23:10 UTC) #6
horo
Thank you! https://codereview.chromium.org/640923003/diff/20001/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc (right): https://codereview.chromium.org/640923003/diff/20001/content/browser/service_worker/service_worker_write_to_cache_job.cc#newcode373 content/browser/service_worker/service_worker_write_to_cache_job.cc:373: // No more data to process, the ...
6 years, 2 months ago (2014-10-20 02:06:50 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/640923003/40001
6 years, 2 months ago (2014-10-20 02:08:24 UTC) #9
commit-bot: I haz the power
Committed patchset #3 (id:40001)
6 years, 2 months ago (2014-10-20 09:33:26 UTC) #10
commit-bot: I haz the power
6 years, 2 months ago (2014-10-20 09:34:18 UTC) #11
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/a67ddd2ace106615b22015f34ae9117a8e44699d
Cr-Commit-Position: refs/heads/master@{#300233}

Powered by Google App Engine
This is Rietveld 408576698