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