| 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_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 // The transaction started synchronously, but we need to notify the | 341 // The transaction started synchronously, but we need to notify the |
| 342 // URLRequest delegate via the message loop. | 342 // URLRequest delegate via the message loop. |
| 343 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( | 343 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( |
| 344 this, &URLRequestHttpJob::OnStartCompleted, rv)); | 344 this, &URLRequestHttpJob::OnStartCompleted, rv)); |
| 345 } | 345 } |
| 346 | 346 |
| 347 bool URLRequestHttpJob::GetMoreData() { | 347 bool URLRequestHttpJob::GetMoreData() { |
| 348 return transaction_.get() && !read_in_progress_; | 348 return transaction_.get() && !read_in_progress_; |
| 349 } | 349 } |
| 350 | 350 |
| 351 bool URLRequestHttpJob::ReadRawData(char* buf, int buf_size, int *bytes_read) { | 351 bool URLRequestHttpJob::ReadRawData(net::IOBuffer* buf, int buf_size, |
| 352 int *bytes_read) { |
| 352 DCHECK_NE(buf_size, 0); | 353 DCHECK_NE(buf_size, 0); |
| 353 DCHECK(bytes_read); | 354 DCHECK(bytes_read); |
| 354 DCHECK(!read_in_progress_); | 355 DCHECK(!read_in_progress_); |
| 355 | 356 |
| 356 int rv = transaction_->Read(buf, buf_size, &read_callback_); | 357 int rv = transaction_->Read(buf, buf_size, &read_callback_); |
| 357 if (rv >= 0) { | 358 if (rv >= 0) { |
| 358 *bytes_read = rv; | 359 *bytes_read = rv; |
| 359 return true; | 360 return true; |
| 360 } | 361 } |
| 361 | 362 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 DCHECK(response_cookies_.empty()); | 547 DCHECK(response_cookies_.empty()); |
| 547 | 548 |
| 548 std::string name = "Set-Cookie"; | 549 std::string name = "Set-Cookie"; |
| 549 std::string value; | 550 std::string value; |
| 550 | 551 |
| 551 void* iter = NULL; | 552 void* iter = NULL; |
| 552 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) | 553 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) |
| 553 response_cookies_.push_back(value); | 554 response_cookies_.push_back(value); |
| 554 } | 555 } |
| 555 | 556 |
| OLD | NEW |