| 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 #include "net/url_request/url_fetcher_core.h" | 5 #include "net/url_request/url_fetcher_core.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 if (!is_chunked_upload_) { | 190 if (!is_chunked_upload_) { |
| 191 AssertHasNoUploadData(); | 191 AssertHasNoUploadData(); |
| 192 DCHECK(upload_content_type_.empty()); | 192 DCHECK(upload_content_type_.empty()); |
| 193 } | 193 } |
| 194 | 194 |
| 195 // Empty |content_type| is not allowed here, because it is impossible | 195 // Empty |content_type| is not allowed here, because it is impossible |
| 196 // to ensure non-empty upload content as it is not yet supplied. | 196 // to ensure non-empty upload content as it is not yet supplied. |
| 197 DCHECK(!content_type.empty()); | 197 DCHECK(!content_type.empty()); |
| 198 | 198 |
| 199 upload_content_type_ = content_type; | 199 upload_content_type_ = content_type; |
| 200 upload_content_.clear(); | 200 base::STLClearObject(&upload_content_); |
| 201 is_chunked_upload_ = true; | 201 is_chunked_upload_ = true; |
| 202 } | 202 } |
| 203 | 203 |
| 204 void URLFetcherCore::AppendChunkToUpload(const std::string& content, | 204 void URLFetcherCore::AppendChunkToUpload(const std::string& content, |
| 205 bool is_last_chunk) { | 205 bool is_last_chunk) { |
| 206 DCHECK(delegate_task_runner_); | 206 DCHECK(delegate_task_runner_); |
| 207 DCHECK(network_task_runner_.get()); | 207 DCHECK(network_task_runner_.get()); |
| 208 DCHECK(is_chunked_upload_); | 208 DCHECK(is_chunked_upload_); |
| 209 network_task_runner_->PostTask( | 209 network_task_runner_->PostTask( |
| 210 FROM_HERE, | 210 FROM_HERE, |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 } | 955 } |
| 956 | 956 |
| 957 void URLFetcherCore::AssertHasNoUploadData() const { | 957 void URLFetcherCore::AssertHasNoUploadData() const { |
| 958 DCHECK(!upload_content_set_); | 958 DCHECK(!upload_content_set_); |
| 959 DCHECK(upload_content_.empty()); | 959 DCHECK(upload_content_.empty()); |
| 960 DCHECK(upload_file_path_.empty()); | 960 DCHECK(upload_file_path_.empty()); |
| 961 DCHECK(upload_stream_factory_.is_null()); | 961 DCHECK(upload_stream_factory_.is_null()); |
| 962 } | 962 } |
| 963 | 963 |
| 964 } // namespace net | 964 } // namespace net |
| OLD | NEW |