| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |