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

Issue 7646025: Detect file system errors during downloads. (Closed)

Created:
9 years, 4 months ago by ahendrickson
Modified:
9 years, 3 months ago
CC:
chromium-reviews, rginda+watch_chromium.org, achuith+watch_chromium.org, rdsmith+dwatch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Detect file system errors during downloads. Moving towards giving the user feedback when a file system error occurs during a download. Split from CL 7134019. BUG=85240 TEST=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98725

Patch Set 1 #

Total comments: 20

Patch Set 2 : Changes per Chris' comments. #

Patch Set 3 : Merged with trunk. #

Total comments: 18

Patch Set 4 : Added unit test for BaseFile error detection. #

Patch Set 5 : Refactored unit test to remove extraneous functions from FileStream. #

Total comments: 1

Patch Set 6 : Fixed comment. #

Total comments: 17

Patch Set 7 : Created unit test for Download Manager's handling of file errors. #

Patch Set 8 : Added missing file #

Patch Set 9 : Merged with trunk. #

Patch Set 10 : Fixed merge error. #

Patch Set 11 : Fixed Linux compile error. #

Total comments: 18

Patch Set 12 : Removed illegal include from content. #

Total comments: 6

Patch Set 13 : Cleaned up unit test per Randy's comments. #

Patch Set 14 : Cleanup per Wan-Teh's comments. #

Patch Set 15 : Merged with trunk. #

Total comments: 38

Patch Set 16 : Incorporated Randy and Chris' comments. #

Patch Set 17 : Fixed Clang problem by moving MockFileStream method bodies to a cc file. #

Total comments: 2

Patch Set 18 : Added missing new file. #

Patch Set 19 : Minor refactor of DownloadFileWithMockStream class. #

Total comments: 7

Patch Set 20 : Changed namespace for MockFileStream. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+500 lines, -112 lines) Patch
M chrome/browser/download/download_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 9 chunks +158 lines, -6 lines 0 comments Download
M content/browser/download/base_file.h View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/download/base_file.cc View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -1 line 0 comments Download
M content/browser/download/base_file_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 11 chunks +62 lines, -19 lines 0 comments Download
M content/browser/download/download_file_manager.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -3 lines 0 comments Download
M content/browser/download/download_file_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +65 lines, -14 lines 0 comments Download
M content/browser/download/download_file_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/download/download_item.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -3 lines 0 comments Download
M content/browser/download/download_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +18 lines, -3 lines 0 comments Download
M content/browser/download/download_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +41 lines, -50 lines 0 comments Download
M net/base/file_stream.h View 1 2 3 4 4 chunks +11 lines, -11 lines 0 comments Download
A net/base/mock_file_stream.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +75 lines, -0 lines 0 comments Download
A net/base/mock_file_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +50 lines, -0 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (0 generated)
ahendrickson
9 years, 4 months ago (2011-08-15 23:40:55 UTC) #1
cbentzel
I didn't see any tests for the file-error-on-append-bytes case. Are there any? http://codereview.chromium.org/7646025/diff/1/chrome/browser/download/download_file_manager.cc File chrome/browser/download/download_file_manager.cc ...
9 years, 4 months ago (2011-08-16 15:50:36 UTC) #2
ahendrickson
On 2011/08/16 15:50:36, cbentzel wrote: > I didn't see any tests for the file-error-on-append-bytes case. ...
9 years, 4 months ago (2011-08-18 21:52:01 UTC) #3
cbentzel
Please add a unit test. It would have caught the use-after-free error I discovered by ...
9 years, 4 months ago (2011-08-19 13:02:41 UTC) #4
ahendrickson
http://codereview.chromium.org/7646025/diff/1/chrome/browser/download/download_file_manager.cc File chrome/browser/download/download_file_manager.cc (right): http://codereview.chromium.org/7646025/diff/1/chrome/browser/download/download_file_manager.cc#newcode187 chrome/browser/download/download_file_manager.cc:187: CancelDownload(id); On 2011/08/19 13:02:41, cbentzel wrote: > On 2011/08/18 ...
9 years, 4 months ago (2011-08-19 18:11:58 UTC) #5
cbentzel
sounds good, thanks for the explanation. I now agree that the CancelDownload here is safer. ...
9 years, 4 months ago (2011-08-19 18:17:13 UTC) #6
cbentzel
At this point I'm happy with how this is implemented, but I am going to ...
9 years, 4 months ago (2011-08-19 18:28:38 UTC) #7
ahendrickson
On 2011/08/19 18:28:38, cbentzel wrote: > At this point I'm happy with how this is ...
9 years, 4 months ago (2011-08-19 18:43:27 UTC) #8
cbentzel
http://codereview.chromium.org/7646025/diff/11001/content/browser/download/download_file_manager.cc File content/browser/download/download_file_manager.cc (right): http://codereview.chromium.org/7646025/diff/11001/content/browser/download/download_file_manager.cc#newcode180 content/browser/download/download_file_manager.cc:180: std::string hash; hash does not appear to be used. ...
9 years, 4 months ago (2011-08-19 18:44:21 UTC) #9
Randy Smith (Not in Mondays)
With the below notes, and agreeing with Chris about the unit test, LGTM. http://codereview.chromium.org/7646025/diff/11001/content/browser/download/download_file_manager.cc File ...
9 years, 4 months ago (2011-08-19 20:09:13 UTC) #10
ahendrickson
http://codereview.chromium.org/7646025/diff/11001/content/browser/download/download_file_manager.cc File content/browser/download/download_file_manager.cc (right): http://codereview.chromium.org/7646025/diff/11001/content/browser/download/download_file_manager.cc#newcode180 content/browser/download/download_file_manager.cc:180: std::string hash; On 2011/08/19 18:44:21, cbentzel wrote: > hash ...
9 years, 4 months ago (2011-08-22 14:53:30 UTC) #11
Randy Smith (Not in Mondays)
Test LGTM. Who's your reviewer for the FileStream changes? http://codereview.chromium.org/7646025/diff/24001/content/browser/download/download_file_manager.cc File content/browser/download/download_file_manager.cc (right): http://codereview.chromium.org/7646025/diff/24001/content/browser/download/download_file_manager.cc#newcode185 content/browser/download/download_file_manager.cc:185: ...
9 years, 4 months ago (2011-08-22 15:26:26 UTC) #12
ahendrickson
darin, wtc: PTAL net/base/file_stream.h. I made the FileStream class use virtual functions, in order to ...
9 years, 4 months ago (2011-08-22 19:00:40 UTC) #13
wtc
LGTM on net/base/file_stream.h only. I didn't review the other files except for the MockFileStream class ...
9 years, 4 months ago (2011-08-23 00:18:35 UTC) #14
cbentzel
I'm sorry I wasn't clearer. The unit test [or possibly browser test] I want to ...
9 years, 4 months ago (2011-08-23 01:34:01 UTC) #15
ahendrickson
Added a unit test for DownloadManager's handling of file errors. http://codereview.chromium.org/7646025/diff/28002/content/browser/download/base_file_unittest.cc File content/browser/download/base_file_unittest.cc (right): http://codereview.chromium.org/7646025/diff/28002/content/browser/download/base_file_unittest.cc#newcode25 ...
9 years, 3 months ago (2011-08-25 21:55:15 UTC) #16
Randy Smith (Not in Mondays)
http://codereview.chromium.org/7646025/diff/38002/chrome/browser/download/download_manager_unittest.cc File chrome/browser/download/download_manager_unittest.cc (right): http://codereview.chromium.org/7646025/diff/38002/chrome/browser/download/download_manager_unittest.cc#newcode173 chrome/browser/download/download_manager_unittest.cc:173: static_cast<testing::MockFileStream *>(file_stream_.get()); This kind of upcasting is nervous making ...
9 years, 3 months ago (2011-08-26 18:51:40 UTC) #17
wtc
I only reviewed the files under src/net. http://codereview.chromium.org/7646025/diff/40001/net/base/mock_file_stream.h File net/base/mock_file_stream.h (right): http://codereview.chromium.org/7646025/diff/40001/net/base/mock_file_stream.h#newcode42 net/base/mock_file_stream.h:42: OVERRIDE { ...
9 years, 3 months ago (2011-08-26 20:51:50 UTC) #18
ahendrickson
http://codereview.chromium.org/7646025/diff/38002/chrome/browser/download/download_manager_unittest.cc File chrome/browser/download/download_manager_unittest.cc (right): http://codereview.chromium.org/7646025/diff/38002/chrome/browser/download/download_manager_unittest.cc#newcode173 chrome/browser/download/download_manager_unittest.cc:173: static_cast<testing::MockFileStream *>(file_stream_.get()); On 2011/08/26 18:51:40, rdsmith wrote: > This ...
9 years, 3 months ago (2011-08-26 21:06:54 UTC) #19
Randy Smith (Not in Mondays)
http://codereview.chromium.org/7646025/diff/49001/chrome/browser/download/download_manager_unittest.cc File chrome/browser/download/download_manager_unittest.cc (right): http://codereview.chromium.org/7646025/diff/49001/chrome/browser/download/download_manager_unittest.cc#newcode175 chrome/browser/download/download_manager_unittest.cc:175: testing::MockFileStream* mock_stream = Please put in a comment as ...
9 years, 3 months ago (2011-08-28 22:14:02 UTC) #20
cbentzel
http://codereview.chromium.org/7646025/diff/49001/chrome/browser/download/download_manager_unittest.cc File chrome/browser/download/download_manager_unittest.cc (right): http://codereview.chromium.org/7646025/diff/49001/chrome/browser/download/download_manager_unittest.cc#newcode85 chrome/browser/download/download_manager_unittest.cc:85: void UpdateData(int32 id, const void* data, size_t length) { ...
9 years, 3 months ago (2011-08-29 15:05:27 UTC) #21
ahendrickson
Caveat: Still waiting on results of linux_clang bot on previous patch. http://codereview.chromium.org/7646025/diff/49001/chrome/browser/download/download_manager_unittest.cc File chrome/browser/download/download_manager_unittest.cc (right): ...
9 years, 3 months ago (2011-08-29 16:30:53 UTC) #22
Randy Smith (Not in Mondays)
A few question responses on discussions between Chris and you; continuing on to full review ...
9 years, 3 months ago (2011-08-29 16:57:57 UTC) #23
Randy Smith (Not in Mondays)
LGTM, with the below nit, and the caveat that I couldn't figure out what file ...
9 years, 3 months ago (2011-08-29 17:02:07 UTC) #24
cbentzel
LGTM http://codereview.chromium.org/7646025/diff/49001/chrome/browser/download/download_manager_unittest.cc File chrome/browser/download/download_manager_unittest.cc (right): http://codereview.chromium.org/7646025/diff/49001/chrome/browser/download/download_manager_unittest.cc#newcode182 chrome/browser/download/download_manager_unittest.cc:182: virtual void CreateFileStream() { On 2011/08/29 16:30:53, ahendrickson ...
9 years, 3 months ago (2011-08-29 17:27:54 UTC) #25
ahendrickson
wtc: PTAL http://codereview.chromium.org/7646025/diff/49001/chrome/browser/download/download_manager_unittest.cc File chrome/browser/download/download_manager_unittest.cc (right): http://codereview.chromium.org/7646025/diff/49001/chrome/browser/download/download_manager_unittest.cc#newcode182 chrome/browser/download/download_manager_unittest.cc:182: virtual void CreateFileStream() { On 2011/08/29 17:27:55, ...
9 years, 3 months ago (2011-08-29 17:51:37 UTC) #26
wtc
LGTM on the files under src/net in Patch Set 19. Please address my comments below ...
9 years, 3 months ago (2011-08-29 18:17:05 UTC) #27
ahendrickson
http://codereview.chromium.org/7646025/diff/61006/net/base/mock_file_stream.cc File net/base/mock_file_stream.cc (right): http://codereview.chromium.org/7646025/diff/61006/net/base/mock_file_stream.cc#newcode9 net/base/mock_file_stream.cc:9: #include "net/base/net_errors.h" On 2011/08/29 18:17:05, wtc wrote: > Remove ...
9 years, 3 months ago (2011-08-29 19:42:38 UTC) #28
wtc
LGTM on src/net in Patch Set 20. My preference would be to put MockFileStream in ...
9 years, 3 months ago (2011-08-29 20:01:20 UTC) #29
wtc
http://codereview.chromium.org/7646025/diff/61006/net/base/mock_file_stream.h File net/base/mock_file_stream.h (right): http://codereview.chromium.org/7646025/diff/61006/net/base/mock_file_stream.h#newcode38 net/base/mock_file_stream.h:38: virtual int Flush() OVERRIDE; On 2011/08/29 19:42:38, ahendrickson wrote: ...
9 years, 3 months ago (2011-08-29 20:03:59 UTC) #30
commit-bot: I haz the power
9 years, 3 months ago (2011-08-29 22:59:29 UTC) #31
Change committed as 98725

Powered by Google App Engine
This is Rietveld 408576698