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