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

Issue 2425673006: Make URLFetcherFileWriter::Finish() skip closing file when there is an error (Closed)

Created:
4 years, 2 months ago by xunjieli
Modified:
4 years, 2 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make URLFetcherFileWriter::Finish() skip closing file when there is an error This CL makes URLFetcherFileWriter::Finish() skip closing file when there is an error. If there is an error, Finish() will delete the file after any pending operation completes. TBR=hashimoto@chromium.org TBR=mkwst@chromium.org BUG=487732, 656692 Committed: https://crrev.com/ee63375d9c88e55c832cdf7f6181eb3ffc776695 Cr-Commit-Position: refs/heads/master@{#426540}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address comments and added tests #

Total comments: 6

Patch Set 3 : Address comments to move |owns_file = true| to Initialize() #

Patch Set 4 : Fix another subclass #

Patch Set 5 : Fix another subclass #

Total comments: 4

Patch Set 6 : Cancel pending callback when Finish(net_error<0) is called #

Total comments: 10

Patch Set 7 : Address comments to invalid weak ptrs #

Patch Set 8 : Fix test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+158 lines, -79 lines) Patch
M chrome/browser/devtools/devtools_ui_bindings.cc View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M components/precache/core/precache_fetcher.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/shell/browser/shell_devtools_frontend.cc View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M google_apis/drive/base_requests.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M google_apis/drive/base_requests.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M net/url_request/test_url_fetcher_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_fetcher_core.cc View 2 chunks +2 lines, -1 line 0 comments Download
M net/url_request/url_fetcher_response_writer.h View 1 2 3 4 5 6 5 chunks +17 lines, -15 lines 0 comments Download
M net/url_request/url_fetcher_response_writer.cc View 1 2 3 4 5 6 7 7 chunks +61 lines, -47 lines 0 comments Download
M net/url_request/url_fetcher_response_writer_unittest.cc View 1 2 3 4 5 6 7 6 chunks +64 lines, -6 lines 0 comments Download
M third_party/libaddressinput/chromium/chrome_metadata_source.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 58 (35 generated)
xunjieli
4 years, 2 months ago (2016-10-18 20:06:09 UTC) #2
xunjieli
Seems there are some other classes which subclass URLFetcherResponseWriter. Is it okay to add an ...
4 years, 2 months ago (2016-10-18 20:17:00 UTC) #7
mmenke
https://codereview.chromium.org/2425673006/diff/1/net/url_request/url_fetcher_core.cc File net/url_request/url_fetcher_core.cc (right): https://codereview.chromium.org/2425673006/diff/1/net/url_request/url_fetcher_core.cc#newcode480 net/url_request/url_fetcher_core.cc:480: bytes_read > 0 ? OK : bytes_read, Hrm...I'd normally ...
4 years, 2 months ago (2016-10-18 20:20:02 UTC) #8
mmenke
On 2016/10/18 20:17:00, xunjieli wrote: > Seems there are some other classes which subclass URLFetcherResponseWriter. ...
4 years, 2 months ago (2016-10-18 20:24:23 UTC) #9
xunjieli
Thanks! a couple of questions before I go ahead and change the subclasses. https://codereview.chromium.org/2425673006/diff/1/net/url_request/url_fetcher_core.cc File ...
4 years, 2 months ago (2016-10-18 21:18:08 UTC) #10
mmenke
https://codereview.chromium.org/2425673006/diff/1/net/url_request/url_fetcher_core.cc File net/url_request/url_fetcher_core.cc (right): https://codereview.chromium.org/2425673006/diff/1/net/url_request/url_fetcher_core.cc#newcode480 net/url_request/url_fetcher_core.cc:480: bytes_read > 0 ? OK : bytes_read, On 2016/10/18 ...
4 years, 2 months ago (2016-10-18 21:40:46 UTC) #11
xunjieli
hashimoto@: PTAL google_apis/drive/base_requests.h rouslan@: PTAL third_party/libaddressinput/chromium/chrome_metadata_source.cc dgozman@: PTAL chrome/browser/devtools/devtools_ui_bindings.cc Since the change in these three ...
4 years, 2 months ago (2016-10-19 12:00:21 UTC) #15
xunjieli
bengr@chromium.org: Please review changes in components/precache/core/precache_fetcher.cc Thanks.
4 years, 2 months ago (2016-10-19 12:47:37 UTC) #23
mmenke
https://chromiumcodereview.appspot.com/2425673006/diff/100001/net/url_request/url_fetcher_response_writer_unittest.cc File net/url_request/url_fetcher_response_writer_unittest.cc (right): https://chromiumcodereview.appspot.com/2425673006/diff/100001/net/url_request/url_fetcher_response_writer_unittest.cc#newcode145 net/url_request/url_fetcher_response_writer_unittest.cc:145: EXPECT_THAT(callback2.GetResult(rv), IsOk()); I don't think we want the callback ...
4 years, 2 months ago (2016-10-19 14:18:40 UTC) #30
please use gerrit instead
libaddressinput lgtm
4 years, 2 months ago (2016-10-19 14:24:02 UTC) #31
mmenke
https://chromiumcodereview.appspot.com/2425673006/diff/100001/net/url_request/url_fetcher_response_writer.h File net/url_request/url_fetcher_response_writer.h (right): https://chromiumcodereview.appspot.com/2425673006/diff/100001/net/url_request/url_fetcher_response_writer.h#newcode49 net/url_request/url_fetcher_response_writer.h:49: // graceful shutdown. If ERR_IO_PENDING is returned, |callback| will ...
4 years, 2 months ago (2016-10-19 14:32:30 UTC) #32
dgozman
devtools lgtm
4 years, 2 months ago (2016-10-19 14:54:35 UTC) #33
xunjieli
Thanks! +mkwst@ for content/shell/browser/shell_devtools_frontend.cc https://codereview.chromium.org/2425673006/diff/100001/net/url_request/url_fetcher_response_writer.h File net/url_request/url_fetcher_response_writer.h (right): https://codereview.chromium.org/2425673006/diff/100001/net/url_request/url_fetcher_response_writer.h#newcode49 net/url_request/url_fetcher_response_writer.h:49: // graceful shutdown. If ERR_IO_PENDING ...
4 years, 2 months ago (2016-10-19 15:19:28 UTC) #36
bengr
components/precache/core/precache_fetcher.cc lgtm
4 years, 2 months ago (2016-10-19 16:07:52 UTC) #37
mmenke
On 2016/10/19 16:07:52, bengr wrote: > components/precache/core/precache_fetcher.cc lgtm It suddenly occurs to me that some ...
4 years, 2 months ago (2016-10-19 18:31:20 UTC) #38
mmenke
On 2016/10/19 16:07:52, bengr wrote: > components/precache/core/precache_fetcher.cc lgtm It suddenly occurs to me that some ...
4 years, 2 months ago (2016-10-19 18:31:22 UTC) #39
mmenke
Other subclasses all look fine, noticed a problem, though. https://codereview.chromium.org/2425673006/diff/140001/net/url_request/url_fetcher_response_writer.cc File net/url_request/url_fetcher_response_writer.cc (right): https://codereview.chromium.org/2425673006/diff/140001/net/url_request/url_fetcher_response_writer.cc#newcode69 net/url_request/url_fetcher_response_writer.cc:69: ...
4 years, 2 months ago (2016-10-19 20:49:34 UTC) #40
xunjieli
Thanks for the review! PTAL https://codereview.chromium.org/2425673006/diff/140001/net/url_request/url_fetcher_response_writer.cc File net/url_request/url_fetcher_response_writer.cc (right): https://codereview.chromium.org/2425673006/diff/140001/net/url_request/url_fetcher_response_writer.cc#newcode69 net/url_request/url_fetcher_response_writer.cc:69: file_stream_.reset(new FileStream(file_task_runner_)); On 2016/10/19 ...
4 years, 2 months ago (2016-10-20 15:57:49 UTC) #47
mmenke
LGTM, thanks for investigating and fixing this!
4 years, 2 months ago (2016-10-20 16:21:39 UTC) #48
xunjieli
On 2016/10/20 16:21:39, mmenke wrote: > LGTM, thanks for investigating and fixing this! Thank you. ...
4 years, 2 months ago (2016-10-20 16:43:39 UTC) #49
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/2425673006/180001
4 years, 2 months ago (2016-10-20 16:44:40 UTC) #54
commit-bot: I haz the power
Committed patchset #8 (id:180001)
4 years, 2 months ago (2016-10-20 18:44:59 UTC) #56
commit-bot: I haz the power
4 years, 2 months ago (2016-10-21 13:20:34 UTC) #58
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/ee63375d9c88e55c832cdf7f6181eb3ffc776695
Cr-Commit-Position: refs/heads/master@{#426540}

Powered by Google App Engine
This is Rietveld 408576698