| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/metrics/stats_counters.h" | 9 #include "base/metrics/stats_counters.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| 11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 12 #include "net/base/host_port_pair.h" |
| 12 #include "net/base/load_flags.h" | 13 #include "net/base/load_flags.h" |
| 13 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 14 #include "net/base/net_log.h" | 15 #include "net/base/net_log.h" |
| 15 #include "net/base/ssl_cert_request_info.h" | 16 #include "net/base/ssl_cert_request_info.h" |
| 16 #include "net/base/upload_data.h" | 17 #include "net/base/upload_data.h" |
| 17 #include "net/http/http_network_delegate.h" | 18 #include "net/http/http_network_delegate.h" |
| 18 #include "net/http/http_response_headers.h" | 19 #include "net/http/http_response_headers.h" |
| 19 #include "net/http/http_util.h" | 20 #include "net/http/http_util.h" |
| 20 #include "net/url_request/url_request_context.h" | 21 #include "net/url_request/url_request_context.h" |
| 21 #include "net/url_request/url_request_job.h" | 22 #include "net/url_request/url_request_job.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 | 266 |
| 266 void URLRequest::GetAllResponseHeaders(string* headers) { | 267 void URLRequest::GetAllResponseHeaders(string* headers) { |
| 267 DCHECK(headers); | 268 DCHECK(headers); |
| 268 if (response_info_.headers) { | 269 if (response_info_.headers) { |
| 269 response_info_.headers->GetNormalizedHeaders(headers); | 270 response_info_.headers->GetNormalizedHeaders(headers); |
| 270 } else { | 271 } else { |
| 271 headers->clear(); | 272 headers->clear(); |
| 272 } | 273 } |
| 273 } | 274 } |
| 274 | 275 |
| 276 HostPortPair URLRequest::GetSocketAddress() const { |
| 277 DCHECK(job_); |
| 278 return job_->GetSocketAddress(); |
| 279 } |
| 280 |
| 275 net::HttpResponseHeaders* URLRequest::response_headers() const { | 281 net::HttpResponseHeaders* URLRequest::response_headers() const { |
| 276 return response_info_.headers.get(); | 282 return response_info_.headers.get(); |
| 277 } | 283 } |
| 278 | 284 |
| 279 bool URLRequest::GetResponseCookies(ResponseCookies* cookies) { | 285 bool URLRequest::GetResponseCookies(ResponseCookies* cookies) { |
| 280 DCHECK(job_); | 286 DCHECK(job_); |
| 281 return job_->GetResponseCookies(cookies); | 287 return job_->GetResponseCookies(cookies); |
| 282 } | 288 } |
| 283 | 289 |
| 284 void URLRequest::GetMimeType(string* mime_type) { | 290 void URLRequest::GetMimeType(string* mime_type) { |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 if (found != user_data_.end()) | 642 if (found != user_data_.end()) |
| 637 return found->second.get(); | 643 return found->second.get(); |
| 638 return NULL; | 644 return NULL; |
| 639 } | 645 } |
| 640 | 646 |
| 641 void URLRequest::SetUserData(const void* key, UserData* data) { | 647 void URLRequest::SetUserData(const void* key, UserData* data) { |
| 642 user_data_[key] = linked_ptr<UserData>(data); | 648 user_data_[key] = linked_ptr<UserData>(data); |
| 643 } | 649 } |
| 644 | 650 |
| 645 } // namespace net | 651 } // namespace net |
| OLD | NEW |