| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 return false; | 175 return false; |
| 176 | 176 |
| 177 if (response_cookies_.empty()) | 177 if (response_cookies_.empty()) |
| 178 FetchResponseCookies(); | 178 FetchResponseCookies(); |
| 179 | 179 |
| 180 cookies->clear(); | 180 cookies->clear(); |
| 181 cookies->swap(response_cookies_); | 181 cookies->swap(response_cookies_); |
| 182 return true; | 182 return true; |
| 183 } | 183 } |
| 184 | 184 |
| 185 int URLRequestHttpJob::GetResponseCode() { | 185 int URLRequestHttpJob::GetResponseCode() const { |
| 186 DCHECK(transaction_.get()); | 186 DCHECK(transaction_.get()); |
| 187 | 187 |
| 188 if (!response_info_) | 188 if (!response_info_) |
| 189 return -1; | 189 return -1; |
| 190 | 190 |
| 191 return response_info_->headers->response_code(); | 191 return response_info_->headers->response_code(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 bool URLRequestHttpJob::GetContentEncodings( | 194 bool URLRequestHttpJob::GetContentEncodings( |
| 195 std::vector<Filter::FilterType>* encoding_types) { | 195 std::vector<Filter::FilterType>* encoding_types) { |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 DCHECK(response_info_); | 606 DCHECK(response_info_); |
| 607 DCHECK(response_cookies_.empty()); | 607 DCHECK(response_cookies_.empty()); |
| 608 | 608 |
| 609 std::string name = "Set-Cookie"; | 609 std::string name = "Set-Cookie"; |
| 610 std::string value; | 610 std::string value; |
| 611 | 611 |
| 612 void* iter = NULL; | 612 void* iter = NULL; |
| 613 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) | 613 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) |
| 614 response_cookies_.push_back(value); | 614 response_cookies_.push_back(value); |
| 615 } | 615 } |
| OLD | NEW |