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

Side by Side Diff: google_apis/drive/base_requests.h

Issue 2425673006: Make URLFetcherFileWriter::Finish() skip closing file when there is an error (Closed)
Patch Set: Fix test 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 unified diff | Download patch
« no previous file with comments | « content/shell/browser/shell_devtools_frontend.cc ('k') | google_apis/drive/base_requests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file provides base classes used to issue HTTP requests for Google 5 // This file provides base classes used to issue HTTP requests for Google
6 // APIs. 6 // APIs.
7 7
8 #ifndef GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_ 8 #ifndef GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_
9 #define GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_ 9 #define GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_
10 10
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 const std::string& data() const { return data_; } 128 const std::string& data() const { return data_; }
129 129
130 // Disowns the output file. 130 // Disowns the output file.
131 void DisownFile(); 131 void DisownFile();
132 132
133 // URLFetcherResponseWriter overrides: 133 // URLFetcherResponseWriter overrides:
134 int Initialize(const net::CompletionCallback& callback) override; 134 int Initialize(const net::CompletionCallback& callback) override;
135 int Write(net::IOBuffer* buffer, 135 int Write(net::IOBuffer* buffer,
136 int num_bytes, 136 int num_bytes,
137 const net::CompletionCallback& callback) override; 137 const net::CompletionCallback& callback) override;
138 int Finish(const net::CompletionCallback& callback) override; 138 int Finish(int net_error, const net::CompletionCallback& callback) override;
139 139
140 private: 140 private:
141 void DidWrite(scoped_refptr<net::IOBuffer> buffer, 141 void DidWrite(scoped_refptr<net::IOBuffer> buffer,
142 const net::CompletionCallback& callback, 142 const net::CompletionCallback& callback,
143 int result); 143 int result);
144 144
145 const GetContentCallback get_content_callback_; 145 const GetContentCallback get_content_callback_;
146 std::string data_; 146 std::string data_;
147 std::unique_ptr<net::URLFetcherFileWriter> file_writer_; 147 std::unique_ptr<net::URLFetcherFileWriter> file_writer_;
148 base::WeakPtrFactory<ResponseWriter> weak_ptr_factory_; 148 base::WeakPtrFactory<ResponseWriter> weak_ptr_factory_;
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 const ProgressCallback progress_callback_; 639 const ProgressCallback progress_callback_;
640 const GURL download_url_; 640 const GURL download_url_;
641 const base::FilePath output_file_path_; 641 const base::FilePath output_file_path_;
642 642
643 DISALLOW_COPY_AND_ASSIGN(DownloadFileRequestBase); 643 DISALLOW_COPY_AND_ASSIGN(DownloadFileRequestBase);
644 }; 644 };
645 645
646 } // namespace google_apis 646 } // namespace google_apis
647 647
648 #endif // GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_ 648 #endif // GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_
OLDNEW
« no previous file with comments | « content/shell/browser/shell_devtools_frontend.cc ('k') | google_apis/drive/base_requests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698