| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_request.h" | 5 #include "net/url_request/url_request.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
| 9 #include "base/singleton.h" | 9 #include "base/singleton.h" |
| 10 #include "base/stats_counters.h" | 10 #include "base/stats_counters.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 GetJobManager()->UnregisterRequestInterceptor(interceptor); | 87 GetJobManager()->UnregisterRequestInterceptor(interceptor); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void URLRequest::AppendBytesToUpload(const char* bytes, int bytes_len) { | 90 void URLRequest::AppendBytesToUpload(const char* bytes, int bytes_len) { |
| 91 DCHECK(bytes_len > 0 && bytes); | 91 DCHECK(bytes_len > 0 && bytes); |
| 92 if (!upload_) | 92 if (!upload_) |
| 93 upload_ = new UploadData(); | 93 upload_ = new UploadData(); |
| 94 upload_->AppendBytes(bytes, bytes_len); | 94 upload_->AppendBytes(bytes, bytes_len); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void URLRequest::AppendFileRangeToUpload(const wstring& file_path, | 97 void URLRequest::AppendFileRangeToUpload(const FilePath& file_path, |
| 98 uint64 offset, uint64 length) { | 98 uint64 offset, uint64 length) { |
| 99 DCHECK(file_path.length() > 0 && length > 0); | 99 DCHECK(file_path.value().length() > 0 && length > 0); |
| 100 if (!upload_) | 100 if (!upload_) |
| 101 upload_ = new UploadData(); | 101 upload_ = new UploadData(); |
| 102 upload_->AppendFileRange(file_path, offset, length); | 102 upload_->AppendFileRange(file_path, offset, length); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void URLRequest::set_upload(net::UploadData* upload) { | 105 void URLRequest::set_upload(net::UploadData* upload) { |
| 106 upload_ = upload; | 106 upload_ = upload; |
| 107 } | 107 } |
| 108 | 108 |
| 109 // Get the upload data directly. | 109 // Get the upload data directly. |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 } | 423 } |
| 424 | 424 |
| 425 #ifndef NDEBUG | 425 #ifndef NDEBUG |
| 426 | 426 |
| 427 URLRequestMetrics::~URLRequestMetrics() { | 427 URLRequestMetrics::~URLRequestMetrics() { |
| 428 DLOG_IF(WARNING, object_count != 0) << | 428 DLOG_IF(WARNING, object_count != 0) << |
| 429 "Leaking " << object_count << " URLRequest object(s)"; | 429 "Leaking " << object_count << " URLRequest object(s)"; |
| 430 } | 430 } |
| 431 | 431 |
| 432 #endif | 432 #endif |
| OLD | NEW |