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

Unified Diff: net/url_request/url_fetcher_response_writer.h

Issue 2425673006: Make URLFetcherFileWriter::Finish() skip closing file when there is an error (Closed)
Patch Set: Fix another subclass Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_fetcher_response_writer.h
diff --git a/net/url_request/url_fetcher_response_writer.h b/net/url_request/url_fetcher_response_writer.h
index f739502b9c9eb93e8d6d90bb40a10008dd163878..b65e27c9d2c63707ed69b577313ea6ad49dc08ff 100644
--- a/net/url_request/url_fetcher_response_writer.h
+++ b/net/url_request/url_fetcher_response_writer.h
@@ -45,9 +45,10 @@ class NET_EXPORT URLFetcherResponseWriter {
int num_bytes,
const CompletionCallback& callback) = 0;
- // Finishes writing. If ERR_IO_PENDING is returned, |callback| will be run
+ // Finishes writing. If |net_error| is not OK, the writer might choose to skip
+ // graceful shutdown. If ERR_IO_PENDING is returned, |callback| will be run
mmenke 2016/10/19 14:32:29 Also, think we should be more explicit that if net
xunjieli 2016/10/19 15:19:28 Done.
// later with the result.
- virtual int Finish(const CompletionCallback& callback) = 0;
+ virtual int Finish(int net_error, const CompletionCallback& callback) = 0;
// Returns this instance's pointer as URLFetcherStringWriter when possible.
virtual URLFetcherStringWriter* AsStringWriter();
@@ -69,7 +70,7 @@ class NET_EXPORT URLFetcherStringWriter : public URLFetcherResponseWriter {
int Write(IOBuffer* buffer,
int num_bytes,
const CompletionCallback& callback) override;
- int Finish(const CompletionCallback& callback) override;
+ int Finish(int net_error, const CompletionCallback& callback) override;
URLFetcherStringWriter* AsStringWriter() override;
private:
@@ -95,7 +96,7 @@ class NET_EXPORT URLFetcherFileWriter : public URLFetcherResponseWriter {
int Write(IOBuffer* buffer,
int num_bytes,
const CompletionCallback& callback) override;
- int Finish(const CompletionCallback& callback) override;
+ int Finish(int net_error, const CompletionCallback& callback) override;
URLFetcherFileWriter* AsFileWriter() override;
// Drops ownership of the file at |file_path_|.

Powered by Google App Engine
This is Rietveld 408576698