| 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/logging.h" | |
| 9 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 10 #include "base/metrics/stats_counters.h" | 9 #include "base/metrics/stats_counters.h" |
| 11 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| 12 #include "net/base/load_flags.h" | 11 #include "net/base/load_flags.h" |
| 13 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 14 #include "net/base/net_log.h" | 13 #include "net/base/net_log.h" |
| 15 #include "net/base/ssl_cert_request_info.h" | 14 #include "net/base/ssl_cert_request_info.h" |
| 16 #include "net/base/upload_data.h" | 15 #include "net/base/upload_data.h" |
| 17 #include "net/http/http_response_headers.h" | 16 #include "net/http/http_response_headers.h" |
| 18 #include "net/http/http_util.h" | 17 #include "net/http/http_util.h" |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 } | 581 } |
| 583 | 582 |
| 584 int64 URLRequest::GetExpectedContentSize() const { | 583 int64 URLRequest::GetExpectedContentSize() const { |
| 585 int64 expected_content_size = -1; | 584 int64 expected_content_size = -1; |
| 586 if (job_) | 585 if (job_) |
| 587 expected_content_size = job_->expected_content_size(); | 586 expected_content_size = job_->expected_content_size(); |
| 588 | 587 |
| 589 return expected_content_size; | 588 return expected_content_size; |
| 590 } | 589 } |
| 591 | 590 |
| 592 void URLRequest::set_priority(net::RequestPriority priority) { | |
| 593 DCHECK_GE(priority, net::HIGHEST); | |
| 594 DCHECK_LT(priority, net::NUM_PRIORITIES); | |
| 595 priority_ = priority; | |
| 596 } | |
| 597 | |
| 598 URLRequest::UserData* URLRequest::GetUserData(const void* key) const { | 591 URLRequest::UserData* URLRequest::GetUserData(const void* key) const { |
| 599 UserDataMap::const_iterator found = user_data_.find(key); | 592 UserDataMap::const_iterator found = user_data_.find(key); |
| 600 if (found != user_data_.end()) | 593 if (found != user_data_.end()) |
| 601 return found->second.get(); | 594 return found->second.get(); |
| 602 return NULL; | 595 return NULL; |
| 603 } | 596 } |
| 604 | 597 |
| 605 void URLRequest::SetUserData(const void* key, UserData* data) { | 598 void URLRequest::SetUserData(const void* key, UserData* data) { |
| 606 user_data_[key] = linked_ptr<UserData>(data); | 599 user_data_[key] = linked_ptr<UserData>(data); |
| 607 } | 600 } |
| OLD | NEW |