OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 // Returns the HTTP response code (e.g., 200, 404, and so on). This method | 543 // Returns the HTTP response code (e.g., 200, 404, and so on). This method |
544 // may only be called once the delegate's OnResponseStarted method has been | 544 // may only be called once the delegate's OnResponseStarted method has been |
545 // called. For non-HTTP requests, this method returns -1. | 545 // called. For non-HTTP requests, this method returns -1. |
546 int GetResponseCode() const; | 546 int GetResponseCode() const; |
547 | 547 |
548 // Get the HTTP response info in its entirety. | 548 // Get the HTTP response info in its entirety. |
549 const HttpResponseInfo& response_info() const { return response_info_; } | 549 const HttpResponseInfo& response_info() const { return response_info_; } |
550 | 550 |
551 // Access the LOAD_* flags modifying this request (see load_flags.h). | 551 // Access the LOAD_* flags modifying this request (see load_flags.h). |
552 int load_flags() const { return load_flags_; } | 552 int load_flags() const { return load_flags_; } |
553 void set_load_flags(int flags) { load_flags_ = flags; } | 553 |
| 554 // The new flags may change the IGNORE_LIMITS flag only when called |
| 555 // before Start() is called, it must only set the flag, and if set, |
| 556 // the priority of this request must already be MAXIMUM_PRIORITY. |
| 557 void SetLoadFlags(int flags); |
554 | 558 |
555 // Returns true if the request is "pending" (i.e., if Start() has been called, | 559 // Returns true if the request is "pending" (i.e., if Start() has been called, |
556 // and the response has not yet been called). | 560 // and the response has not yet been called). |
557 bool is_pending() const { return is_pending_; } | 561 bool is_pending() const { return is_pending_; } |
558 | 562 |
559 // Returns true if the request is in the process of redirecting to a new | 563 // Returns true if the request is in the process of redirecting to a new |
560 // URL but has not yet initiated the new request. | 564 // URL but has not yet initiated the new request. |
561 bool is_redirecting() const { return is_redirecting_; } | 565 bool is_redirecting() const { return is_redirecting_; } |
562 | 566 |
563 // Returns the error status of the request. | 567 // Returns the error status of the request. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 const URLRequestContext* context() const; | 648 const URLRequestContext* context() const; |
645 | 649 |
646 const BoundNetLog& net_log() const { return net_log_; } | 650 const BoundNetLog& net_log() const { return net_log_; } |
647 | 651 |
648 // Returns the expected content size if available | 652 // Returns the expected content size if available |
649 int64 GetExpectedContentSize() const; | 653 int64 GetExpectedContentSize() const; |
650 | 654 |
651 // Returns the priority level for this request. | 655 // Returns the priority level for this request. |
652 RequestPriority priority() const { return priority_; } | 656 RequestPriority priority() const { return priority_; } |
653 | 657 |
654 // Sets the priority level for this request and any related jobs. | 658 // Sets the priority level for this request and any related |
| 659 // jobs. Must not change the priority to anything other than |
| 660 // MAXIMUM_PRIORITY if the IGNORE_LIMITS load flag is set. |
655 void SetPriority(RequestPriority priority); | 661 void SetPriority(RequestPriority priority); |
656 | 662 |
657 // Returns true iff this request would be internally redirected to HTTPS | 663 // Returns true iff this request would be internally redirected to HTTPS |
658 // due to HSTS. If so, |redirect_url| is rewritten to the new HTTPS URL. | 664 // due to HSTS. If so, |redirect_url| is rewritten to the new HTTPS URL. |
659 bool GetHSTSRedirect(GURL* redirect_url) const; | 665 bool GetHSTSRedirect(GURL* redirect_url) const; |
660 | 666 |
661 // TODO(willchan): Undo this. Only temporarily public. | 667 // TODO(willchan): Undo this. Only temporarily public. |
662 bool has_delegate() const { return delegate_ != NULL; } | 668 bool has_delegate() const { return delegate_ != NULL; } |
663 | 669 |
664 // NOTE(willchan): This is just temporary for debugging | 670 // NOTE(willchan): This is just temporary for debugging |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 bool is_redirecting_; | 826 bool is_redirecting_; |
821 | 827 |
822 // Number of times we're willing to redirect. Used to guard against | 828 // Number of times we're willing to redirect. Used to guard against |
823 // infinite redirects. | 829 // infinite redirects. |
824 int redirect_limit_; | 830 int redirect_limit_; |
825 | 831 |
826 // Cached value for use after we've orphaned the job handling the | 832 // Cached value for use after we've orphaned the job handling the |
827 // first transaction in a request involving redirects. | 833 // first transaction in a request involving redirects. |
828 UploadProgress final_upload_progress_; | 834 UploadProgress final_upload_progress_; |
829 | 835 |
830 // The priority level for this request. Objects like ClientSocketPool use | 836 // The priority level for this request. Objects like |
831 // this to determine which URLRequest to allocate sockets to first. | 837 // ClientSocketPool use this to determine which URLRequest to |
| 838 // allocate sockets to first. |
832 RequestPriority priority_; | 839 RequestPriority priority_; |
833 | 840 |
834 // TODO(battre): The only consumer of the identifier_ is currently the | 841 // TODO(battre): The only consumer of the identifier_ is currently the |
835 // web request API. We need to match identifiers of requests between the | 842 // web request API. We need to match identifiers of requests between the |
836 // web request API and the web navigation API. As the URLRequest does not | 843 // web request API and the web navigation API. As the URLRequest does not |
837 // exist when the web navigation API is triggered, the tracking probably | 844 // exist when the web navigation API is triggered, the tracking probably |
838 // needs to be done outside of the URLRequest anyway. Therefore, this | 845 // needs to be done outside of the URLRequest anyway. Therefore, this |
839 // identifier should be deleted here. http://crbug.com/89321 | 846 // identifier should be deleted here. http://crbug.com/89321 |
840 // A globally unique identifier for this request. | 847 // A globally unique identifier for this request. |
841 const uint64 identifier_; | 848 const uint64 identifier_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 LoadTimingInfo load_timing_info_; | 883 LoadTimingInfo load_timing_info_; |
877 | 884 |
878 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 885 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
879 | 886 |
880 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 887 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
881 }; | 888 }; |
882 | 889 |
883 } // namespace net | 890 } // namespace net |
884 | 891 |
885 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 892 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |