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

Issue 868253012: [net] Subtract timestamps to determine if uploading file changed. (Closed)

Created:
5 years, 10 months ago by asanka
Modified:
5 years, 10 months ago
Reviewers:
mmenke
CC:
cbentzel+watch_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[net] Subtract timestamps to determine if uploading file changed. UploadFileElementReader relies on checking the modified time of files being uploaded to determine if a sliced file was modified during upload. Clients of the net stack (in particular Blink) currently pass around the expected modified time in a manner which cause the timestamp to lose precision (E.g. converting to and from a double time_t). As a result the expected timestamp and the current timestamp as returned by GetFileInfo() will not match exactly. Current code attempted to compensate for this by converting both timestamps to (integer) time_t. However, since the conversion rounds down, this check would only succeed if the loss of precision of the expected timestamp also caused it to round down. This is not always the case. (E.g. (epoch + 10.999999) will become 10 when converted to time_t, but the expected timestamp may have rounded up to (epoch + 11.0) in the meantime.) This patch compares the timestamps by checking if the magnitude of the difference is less than one second. BUG=426465 CQ_EXTRA_TRYBOTS=tryserver.blink:linux_blink_rel,linux_blink_dbg,mac_blink_rel,win_blink_rel R=mmenke Committed: https://crrev.com/b77c8ffae588001875fb50ead987a147ca882bdb Cr-Commit-Position: refs/heads/master@{#314397} Reverted: https://crrev.com/7ccf4fab5d4473e431f1a289056033eea0b3dd43 Cr-Commit-Position: refs/heads/master@{#314451} Committed: https://crrev.com/91430c35820e73f2e388a94e8f6260be79e480a8 Cr-Commit-Position: refs/heads/master@{#314634}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Formatting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -15 lines) Patch
M net/base/upload_file_element_reader.cc View 1 chunk +8 lines, -5 lines 0 comments Download
M net/base/upload_file_element_reader_unittest.cc View 1 1 chunk +18 lines, -10 lines 0 comments Download

Messages

Total messages: 15 (2 generated)
asanka
5 years, 10 months ago (2015-01-30 20:39:38 UTC) #1
mmenke
LGTM. Also, in your description, checkinf -> checking https://codereview.chromium.org/868253012/diff/1/net/base/upload_file_element_reader_unittest.cc File net/base/upload_file_element_reader_unittest.cc (right): https://codereview.chromium.org/868253012/diff/1/net/base/upload_file_element_reader_unittest.cc#newcode232 net/base/upload_file_element_reader_unittest.cc:232: expected_modification_time)); ...
5 years, 10 months ago (2015-02-02 15:34:21 UTC) #2
asanka
Thanks! On 2015/02/02 at 15:34:21, mmenke wrote: > LGTM. Also, in your description, checkinf -> ...
5 years, 10 months ago (2015-02-03 19:22:32 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/868253012/20001
5 years, 10 months ago (2015-02-03 19:23:58 UTC) #5
mmenke
On 2015/02/03 19:22:32, asanka wrote: > Thanks! > > On 2015/02/02 at 15:34:21, mmenke wrote: ...
5 years, 10 months ago (2015-02-03 19:24:27 UTC) #6
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 10 months ago (2015-02-03 20:18:54 UTC) #7
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/b77c8ffae588001875fb50ead987a147ca882bdb Cr-Commit-Position: refs/heads/master@{#314397}
5 years, 10 months ago (2015-02-03 20:20:04 UTC) #8
Noel Gordon
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/893323003/ by noel@chromium.org. ...
5 years, 10 months ago (2015-02-04 00:47:04 UTC) #9
Noel Gordon
When landing chromium changes via CQ, and you suspect might break something in blink, add ...
5 years, 10 months ago (2015-02-04 01:23:25 UTC) #10
asanka
On 2015/02/04 at 01:23:25, noel wrote: > When landing chromium changes via CQ, and you ...
5 years, 10 months ago (2015-02-04 19:43:39 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/868253012/20001
5 years, 10 months ago (2015-02-04 19:46:04 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 10 months ago (2015-02-04 21:13:50 UTC) #14
commit-bot: I haz the power
5 years, 10 months ago (2015-02-04 21:15:49 UTC) #15
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/91430c35820e73f2e388a94e8f6260be79e480a8
Cr-Commit-Position: refs/heads/master@{#314634}

Powered by Google App Engine
This is Rietveld 408576698