Chromium Code Reviews
Help | Chromium Project | Sign in
(27)

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

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 month, 1 week ago by qinmin
Modified:
1 month, 1 week 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
Commit queue not available (can’t edit this change).

Messages

Total messages: 38 (24 generated)
qinmin
PTAL
1 month, 1 week 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 ...
1 month, 1 week 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 ...
1 month, 1 week 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 ...
1 month, 1 week ago (2017-02-15 20:43:57 UTC) #10
qinmin
ping, asanka@, please take a look, thanks
1 month, 1 week 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 ...
1 month, 1 week ago (2017-02-16 18:11:24 UTC) #24
David Trainor-ping if over 24h
On 2017/02/16 18:11:24, asanka wrote: > I suspect that handling things like renames are going ...
1 month, 1 week 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 ...
1 month, 1 week 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 ...
1 month, 1 week 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, ...
1 month, 1 week 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 ...
1 month, 1 week 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, ...
1 month, 1 week 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
1 month, 1 week ago (2017-02-17 07:51:09 UTC) #35
commit-bot: I haz the power
1 month, 1 week 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...
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld d1a128a62