| 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/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 status_.set_os_error(os_error); | 245 status_.set_os_error(os_error); |
| 246 } | 246 } |
| 247 | 247 |
| 248 job_->Kill(); | 248 job_->Kill(); |
| 249 | 249 |
| 250 // The Job will call our NotifyDone method asynchronously. This is done so | 250 // The Job will call our NotifyDone method asynchronously. This is done so |
| 251 // that the Delegate implementation can call Cancel without having to worry | 251 // that the Delegate implementation can call Cancel without having to worry |
| 252 // about being called recursively. | 252 // about being called recursively. |
| 253 } | 253 } |
| 254 | 254 |
| 255 bool URLRequest::Read(char* dest, int dest_size, int *bytes_read) { | 255 bool URLRequest::Read(net::IOBuffer* dest, int dest_size, int *bytes_read) { |
| 256 DCHECK(job_); | 256 DCHECK(job_); |
| 257 DCHECK(bytes_read); | 257 DCHECK(bytes_read); |
| 258 DCHECK(!job_->is_done()); | 258 DCHECK(!job_->is_done()); |
| 259 *bytes_read = 0; | 259 *bytes_read = 0; |
| 260 | 260 |
| 261 if (dest_size == 0) { | 261 if (dest_size == 0) { |
| 262 // Caller is not too bright. I guess we've done what they asked. | 262 // Caller is not too bright. I guess we've done what they asked. |
| 263 return true; | 263 return true; |
| 264 } | 264 } |
| 265 | 265 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 return net::OK; | 377 return net::OK; |
| 378 } | 378 } |
| 379 | 379 |
| 380 int64 URLRequest::GetExpectedContentSize() const { | 380 int64 URLRequest::GetExpectedContentSize() const { |
| 381 int64 expected_content_size = -1; | 381 int64 expected_content_size = -1; |
| 382 if (job_) | 382 if (job_) |
| 383 expected_content_size = job_->expected_content_size(); | 383 expected_content_size = job_->expected_content_size(); |
| 384 | 384 |
| 385 return expected_content_size; | 385 return expected_content_size; |
| 386 } | 386 } |
| OLD | NEW |