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

Issue 2695153002: Refactor BaseFile class to support sparse files (Closed)

Created:
3 years, 10 months ago by qinmin
Modified:
3 years, 10 months ago
CC:
asanka, chromium-reviews, darin-cc_chromium.org, jam
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor BaseFile class to support sparse files To support parallel downloading, a file might have multiple writers at the same time. This CL refactors the BaseFile class to support sparse files. It adds a method to allow callers to write to arbitrary offsets. And this CL skips all the hash validation logic if the |is_sparse_file_| is true. BUG=644352 Review-Url: https://codereview.chromium.org/2695153002 Cr-Commit-Position: refs/heads/master@{#451276} Committed: https://chromium.googlesource.com/chromium/src/+/f456c408998b5178f9f72810f417d57ffacb6da2

Patch Set 1 #

Total comments: 6

Patch Set 2 : using a single fd #

Total comments: 12

Patch Set 3 : introduce is_sparse_file_ #

Patch Set 4 : remove the while loop around write #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -62 lines) Patch
M content/browser/download/base_file.h View 1 2 3 6 chunks +49 lines, -20 lines 0 comments Download
M content/browser/download/base_file.cc View 1 2 3 6 chunks +33 lines, -23 lines 0 comments Download
M content/browser/download/base_file_unittest.cc View 1 2 18 chunks +56 lines, -16 lines 0 comments Download
M content/browser/download/base_file_win_unittest.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/download/download_file_impl.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/download/save_file.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 38 (24 generated)
qinmin
PTAL
3 years, 10 months ago (2017-02-14 22:47:08 UTC) #2
xingliu
https://codereview.chromium.org/2695153002/diff/20001/content/browser/download/base_file.cc File content/browser/download/base_file.cc (right): https://codereview.chromium.org/2695153002/diff/20001/content/browser/download/base_file.cc#newcode125 content/browser/download/base_file.cc:125: if (secure_hash_) Maybe add DCHECK(access_mode_ == AccessMode::EXCLUSIVE); https://codereview.chromium.org/2695153002/diff/20001/content/browser/download/base_file_unittest.cc File ...
3 years, 10 months ago (2017-02-15 19:13:20 UTC) #8
qinmin
https://codereview.chromium.org/2695153002/diff/20001/content/browser/download/base_file.cc File content/browser/download/base_file.cc (right): https://codereview.chromium.org/2695153002/diff/20001/content/browser/download/base_file.cc#newcode125 content/browser/download/base_file.cc:125: if (secure_hash_) On 2017/02/15 19:13:20, xingliu wrote: > Maybe ...
3 years, 10 months ago (2017-02-15 20:00:43 UTC) #9
xingliu
https://codereview.chromium.org/2695153002/diff/20001/content/browser/download/base_file.cc File content/browser/download/base_file.cc (right): https://codereview.chromium.org/2695153002/diff/20001/content/browser/download/base_file.cc#newcode125 content/browser/download/base_file.cc:125: if (secure_hash_) On 2017/02/15 20:00:43, qinmin wrote: > On ...
3 years, 10 months ago (2017-02-15 20:43:57 UTC) #10
qinmin
ping, asanka@, please take a look, thanks
3 years, 10 months ago (2017-02-16 15:51:23 UTC) #23
asanka
I suspect that handling things like renames are going to be quite fragile if there ...
3 years, 10 months ago (2017-02-16 18:11:24 UTC) #24
David Trainor- moved to gerrit
On 2017/02/16 18:11:24, asanka wrote: > I suspect that handling things like renames are going ...
3 years, 10 months ago (2017-02-16 18:19:48 UTC) #25
asanka
I stand corrected. LGTM, but I still feel that the distinction is whether the file ...
3 years, 10 months ago (2017-02-16 18:46:26 UTC) #26
qinmin
On 2017/02/16 18:46:26, asanka wrote: > I stand corrected. > > LGTM, but I still ...
3 years, 10 months ago (2017-02-16 21:34:17 UTC) #27
qinmin
https://codereview.chromium.org/2695153002/diff/100001/content/browser/download/base_file.cc File content/browser/download/base_file.cc (right): https://codereview.chromium.org/2695153002/diff/100001/content/browser/download/base_file.cc#newcode92 content/browser/download/base_file.cc:92: if (file_.Seek(base::File::FROM_BEGIN, offset) < 0) { On 2017/02/16 18:11:24, ...
3 years, 10 months ago (2017-02-16 21:35:50 UTC) #29
asanka
https://codereview.chromium.org/2695153002/diff/100001/content/browser/download/base_file.cc File content/browser/download/base_file.cc (right): https://codereview.chromium.org/2695153002/diff/100001/content/browser/download/base_file.cc#newcode92 content/browser/download/base_file.cc:92: if (file_.Seek(base::File::FROM_BEGIN, offset) < 0) { On 2017/02/16 at ...
3 years, 10 months ago (2017-02-16 21:58:02 UTC) #30
qinmin
https://codereview.chromium.org/2695153002/diff/100001/content/browser/download/base_file.cc File content/browser/download/base_file.cc (right): https://codereview.chromium.org/2695153002/diff/100001/content/browser/download/base_file.cc#newcode92 content/browser/download/base_file.cc:92: if (file_.Seek(base::File::FROM_BEGIN, offset) < 0) { On 2017/02/16 21:58:02, ...
3 years, 10 months ago (2017-02-16 22:20:29 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2695153002/160001
3 years, 10 months ago (2017-02-17 07:51:09 UTC) #35
commit-bot: I haz the power
3 years, 10 months ago (2017-02-17 10:21:33 UTC) #38
Message was sent while issue was closed.
Committed patchset #4 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/f456c408998b5178f9f72810f417...

Powered by Google App Engine
This is Rietveld 408576698