| 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 #ifndef NET_URL_REQUEST_URL_REQUEST_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" |
| 13 #include "base/debug/leak_tracker.h" | 14 #include "base/debug/leak_tracker.h" |
| 14 #include "base/linked_ptr.h" | 15 #include "base/linked_ptr.h" |
| 15 #include "base/logging.h" | |
| 16 #include "base/non_thread_safe.h" | 16 #include "base/non_thread_safe.h" |
| 17 #include "base/ref_counted.h" | 17 #include "base/ref_counted.h" |
| 18 #include "base/string16.h" | 18 #include "base/string16.h" |
| 19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 20 #include "net/base/load_states.h" | 20 #include "net/base/load_states.h" |
| 21 #include "net/base/net_log.h" | 21 #include "net/base/net_log.h" |
| 22 #include "net/base/request_priority.h" | 22 #include "net/base/request_priority.h" |
| 23 #include "net/http/http_request_headers.h" | 23 #include "net/http/http_request_headers.h" |
| 24 #include "net/http/http_response_info.h" | 24 #include "net/http/http_response_info.h" |
| 25 #include "net/url_request/url_request_status.h" | 25 #include "net/url_request/url_request_status.h" |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 URLRequestContext* context(); | 527 URLRequestContext* context(); |
| 528 void set_context(URLRequestContext* context); | 528 void set_context(URLRequestContext* context); |
| 529 | 529 |
| 530 const net::BoundNetLog& net_log() const { return net_log_; } | 530 const net::BoundNetLog& net_log() const { return net_log_; } |
| 531 | 531 |
| 532 // Returns the expected content size if available | 532 // Returns the expected content size if available |
| 533 int64 GetExpectedContentSize() const; | 533 int64 GetExpectedContentSize() const; |
| 534 | 534 |
| 535 // Returns the priority level for this request. | 535 // Returns the priority level for this request. |
| 536 net::RequestPriority priority() const { return priority_; } | 536 net::RequestPriority priority() const { return priority_; } |
| 537 void set_priority(net::RequestPriority priority) { | 537 void set_priority(net::RequestPriority priority); |
| 538 DCHECK_GE(priority, net::HIGHEST); | |
| 539 DCHECK_LT(priority, net::NUM_PRIORITIES); | |
| 540 priority_ = priority; | |
| 541 } | |
| 542 | 538 |
| 543 #ifdef UNIT_TEST | 539 #ifdef UNIT_TEST |
| 544 URLRequestJob* job() { return job_; } | 540 URLRequestJob* job() { return job_; } |
| 545 #endif | 541 #endif |
| 546 | 542 |
| 547 protected: | 543 protected: |
| 548 // Allow the URLRequestJob class to control the is_pending() flag. | 544 // Allow the URLRequestJob class to control the is_pending() flag. |
| 549 void set_is_pending(bool value) { is_pending_ = value; } | 545 void set_is_pending(bool value) { is_pending_ = value; } |
| 550 | 546 |
| 551 // Allow the URLRequestJob class to set our status too | 547 // Allow the URLRequestJob class to set our status too |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 // The priority level for this request. Objects like ClientSocketPool use | 633 // The priority level for this request. Objects like ClientSocketPool use |
| 638 // this to determine which URLRequest to allocate sockets to first. | 634 // this to determine which URLRequest to allocate sockets to first. |
| 639 net::RequestPriority priority_; | 635 net::RequestPriority priority_; |
| 640 | 636 |
| 641 base::debug::LeakTracker<URLRequest> leak_tracker_; | 637 base::debug::LeakTracker<URLRequest> leak_tracker_; |
| 642 | 638 |
| 643 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 639 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| 644 }; | 640 }; |
| 645 | 641 |
| 646 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 642 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |