OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 int64 GetExpectedContentSize() const; | 554 int64 GetExpectedContentSize() const; |
555 | 555 |
556 // Returns the priority level for this request. | 556 // Returns the priority level for this request. |
557 RequestPriority priority() const { return priority_; } | 557 RequestPriority priority() const { return priority_; } |
558 void set_priority(RequestPriority priority) { | 558 void set_priority(RequestPriority priority) { |
559 DCHECK_GE(priority, HIGHEST); | 559 DCHECK_GE(priority, HIGHEST); |
560 DCHECK_LT(priority, NUM_PRIORITIES); | 560 DCHECK_LT(priority, NUM_PRIORITIES); |
561 priority_ = priority; | 561 priority_ = priority; |
562 } | 562 } |
563 | 563 |
564 #ifdef UNIT_TEST | 564 // This method is intended only for unit tests, but it is being used by |
| 565 // unit tests outside of net :(. |
565 URLRequestJob* job() { return job_; } | 566 URLRequestJob* job() { return job_; } |
566 #endif | |
567 | 567 |
568 protected: | 568 protected: |
569 // Allow the URLRequestJob class to control the is_pending() flag. | 569 // Allow the URLRequestJob class to control the is_pending() flag. |
570 void set_is_pending(bool value) { is_pending_ = value; } | 570 void set_is_pending(bool value) { is_pending_ = value; } |
571 | 571 |
572 // Allow the URLRequestJob class to set our status too | 572 // Allow the URLRequestJob class to set our status too |
573 void set_status(const URLRequestStatus& value) { status_ = value; } | 573 void set_status(const URLRequestStatus& value) { status_ = value; } |
574 | 574 |
575 // Allow the URLRequestJob to redirect this request. Returns OK if | 575 // Allow the URLRequestJob to redirect this request. Returns OK if |
576 // successful, otherwise an error code is returned. | 576 // successful, otherwise an error code is returned. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 // Callback passed to the network delegate to notify us when a blocked request | 671 // Callback passed to the network delegate to notify us when a blocked request |
672 // is ready to be resumed or canceled. | 672 // is ready to be resumed or canceled. |
673 CompletionCallbackImpl<URLRequest> before_request_callback_; | 673 CompletionCallbackImpl<URLRequest> before_request_callback_; |
674 | 674 |
675 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 675 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
676 }; | 676 }; |
677 | 677 |
678 } // namespace net | 678 } // namespace net |
679 | 679 |
680 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 680 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |