| 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 // Returns the HTTP response code (e.g., 200, 404, and so on). This method | 549 // Returns the HTTP response code (e.g., 200, 404, and so on). This method |
| 550 // may only be called once the delegate's OnResponseStarted method has been | 550 // may only be called once the delegate's OnResponseStarted method has been |
| 551 // called. For non-HTTP requests, this method returns -1. | 551 // called. For non-HTTP requests, this method returns -1. |
| 552 int GetResponseCode() const; | 552 int GetResponseCode() const; |
| 553 | 553 |
| 554 // Get the HTTP response info in its entirety. | 554 // Get the HTTP response info in its entirety. |
| 555 const HttpResponseInfo& response_info() const { return response_info_; } | 555 const HttpResponseInfo& response_info() const { return response_info_; } |
| 556 | 556 |
| 557 // Access the LOAD_* flags modifying this request (see load_flags.h). | 557 // Access the LOAD_* flags modifying this request (see load_flags.h). |
| 558 int load_flags() const { return load_flags_; } | 558 int load_flags() const { return load_flags_; } |
| 559 void set_load_flags(int flags) { load_flags_ = flags; } | 559 |
| 560 // The new flags must not change the IGNORE_LIMITS flag (which |
| 561 // affects the result of GetPriority()) if called after Start() is |
| 562 // called. |
| 563 void SetLoadFlags(int flags); |
| 560 | 564 |
| 561 // Returns true if the request is "pending" (i.e., if Start() has been called, | 565 // Returns true if the request is "pending" (i.e., if Start() has been called, |
| 562 // and the response has not yet been called). | 566 // and the response has not yet been called). |
| 563 bool is_pending() const { return is_pending_; } | 567 bool is_pending() const { return is_pending_; } |
| 564 | 568 |
| 565 // Returns true if the request is in the process of redirecting to a new | 569 // Returns true if the request is in the process of redirecting to a new |
| 566 // URL but has not yet initiated the new request. | 570 // URL but has not yet initiated the new request. |
| 567 bool is_redirecting() const { return is_redirecting_; } | 571 bool is_redirecting() const { return is_redirecting_; } |
| 568 | 572 |
| 569 // Returns the error status of the request. | 573 // Returns the error status of the request. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 void ContinueDespiteLastError(); | 651 void ContinueDespiteLastError(); |
| 648 | 652 |
| 649 // Used to specify the context (cookie store, cache) for this request. | 653 // Used to specify the context (cookie store, cache) for this request. |
| 650 const URLRequestContext* context() const; | 654 const URLRequestContext* context() const; |
| 651 | 655 |
| 652 const BoundNetLog& net_log() const { return net_log_; } | 656 const BoundNetLog& net_log() const { return net_log_; } |
| 653 | 657 |
| 654 // Returns the expected content size if available | 658 // Returns the expected content size if available |
| 655 int64 GetExpectedContentSize() const; | 659 int64 GetExpectedContentSize() const; |
| 656 | 660 |
| 657 // Returns the priority level for this request. | 661 // Returns the priority level for this request. Objects like |
| 658 RequestPriority priority() const { return priority_; } | 662 // ClientSocketPool use this to determine which URLRequest to |
| 663 // allocate sockets to first. |
| 664 RequestPriority GetPriority() const; |
| 659 | 665 |
| 660 // Sets the priority level for this request and any related jobs. | 666 // Sets the priority level for this request and any related jobs. |
| 661 void SetPriority(RequestPriority priority); | 667 void SetPriority(RequestPriority priority); |
| 662 | 668 |
| 663 // Returns true iff this request would be internally redirected to HTTPS | 669 // 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. | 670 // due to HSTS. If so, |redirect_url| is rewritten to the new HTTPS URL. |
| 665 bool GetHSTSRedirect(GURL* redirect_url) const; | 671 bool GetHSTSRedirect(GURL* redirect_url) const; |
| 666 | 672 |
| 667 // TODO(willchan): Undo this. Only temporarily public. | 673 // TODO(willchan): Undo this. Only temporarily public. |
| 668 bool has_delegate() const { return delegate_ != NULL; } | 674 bool has_delegate() const { return delegate_ != NULL; } |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 bool is_redirecting_; | 832 bool is_redirecting_; |
| 827 | 833 |
| 828 // Number of times we're willing to redirect. Used to guard against | 834 // Number of times we're willing to redirect. Used to guard against |
| 829 // infinite redirects. | 835 // infinite redirects. |
| 830 int redirect_limit_; | 836 int redirect_limit_; |
| 831 | 837 |
| 832 // Cached value for use after we've orphaned the job handling the | 838 // Cached value for use after we've orphaned the job handling the |
| 833 // first transaction in a request involving redirects. | 839 // first transaction in a request involving redirects. |
| 834 UploadProgress final_upload_progress_; | 840 UploadProgress final_upload_progress_; |
| 835 | 841 |
| 836 // The priority level for this request. Objects like ClientSocketPool use | 842 // The base priority level for this request before load flags are |
| 837 // this to determine which URLRequest to allocate sockets to first. | 843 // taken into account. Should not be used directly; GetPriority() |
| 838 RequestPriority priority_; | 844 // should be used instead. |
| 845 RequestPriority base_priority_; |
| 839 | 846 |
| 840 // TODO(battre): The only consumer of the identifier_ is currently the | 847 // TODO(battre): The only consumer of the identifier_ is currently the |
| 841 // web request API. We need to match identifiers of requests between the | 848 // web request API. We need to match identifiers of requests between the |
| 842 // web request API and the web navigation API. As the URLRequest does not | 849 // web request API and the web navigation API. As the URLRequest does not |
| 843 // exist when the web navigation API is triggered, the tracking probably | 850 // exist when the web navigation API is triggered, the tracking probably |
| 844 // needs to be done outside of the URLRequest anyway. Therefore, this | 851 // needs to be done outside of the URLRequest anyway. Therefore, this |
| 845 // identifier should be deleted here. http://crbug.com/89321 | 852 // identifier should be deleted here. http://crbug.com/89321 |
| 846 // A globally unique identifier for this request. | 853 // A globally unique identifier for this request. |
| 847 const uint64 identifier_; | 854 const uint64 identifier_; |
| 848 | 855 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 LoadTimingInfo load_timing_info_; | 889 LoadTimingInfo load_timing_info_; |
| 883 | 890 |
| 884 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 891 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
| 885 | 892 |
| 886 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 893 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| 887 }; | 894 }; |
| 888 | 895 |
| 889 } // namespace net | 896 } // namespace net |
| 890 | 897 |
| 891 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 898 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |