New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 871655 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 20
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

[ServiceWorkerCacheWriter] bytes_compared_ is not updated correctly

Project Member Reported by momohatt@google.com, Aug 7

Issue description

This private variable |bytes_compared_| represents the bytes which were verified to be identical with the cached data, and to be updated after the cache comparison is finished with current |data_to_write_|. However, |bytes_command_| is incremented only by the amount of |result| and this may result in an incorrect value of |bytes_compared_|, especially when not enough data was read to finish the entire block of data from the network (content/browser/service_worker/service_worker_cache_writer.cc, Line 287).
 
Description: Show this description
Labels: -Pri-3 M-70 Pri-2
Owner: shimazu@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/50b8e88d3a493c0437e540c972491dde155d3bd1

commit 50b8e88d3a493c0437e540c972491dde155d3bd1
Author: momohatt <momohatt@google.com>
Date: Mon Aug 20 02:21:49 2018

[ServiceWorkerCacheWriter] fix update of bytes_compared_

This patch fixes the incorrect updating algorithm of |bytes_compared_|
in DoReadDataForCompareDone. This variable represents the amount of data
from the network which is confirmed to be identical with the cached data,
and is updated every time the comparison finishes for a chunk of data
from the network. Previously it was incremented only by the amount of
bytes read from the cache, which can be less than the size of the chunk
of data from the network in the cases where the cache writer does not
finish the comparison in single read from the cache because the network
data is too large.

Bug:  871655 
Change-Id: Ie3e0f192713b5d38582628c72175e4f7aa6771da
Reviewed-on: https://chromium-review.googlesource.com/1172222
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Makoto Shimazu <shimazu@chromium.org>
Commit-Queue: Momoko Hattori <momohatt@google.com>
Cr-Commit-Position: refs/heads/master@{#584353}
[modify] https://crrev.com/50b8e88d3a493c0437e540c972491dde155d3bd1/content/browser/service_worker/service_worker_cache_writer.cc
[modify] https://crrev.com/50b8e88d3a493c0437e540c972491dde155d3bd1/content/browser/service_worker/service_worker_cache_writer.h
[modify] https://crrev.com/50b8e88d3a493c0437e540c972491dde155d3bd1/content/browser/service_worker/service_worker_cache_writer_unittest.cc

Labels: -OS-Fuchsia
Owner: momohatt@google.com
Status: Fixed (was: Assigned)

Sign in to add a comment