Chromium Code Reviews| 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 671 | 671 |
| 672 // Sets the priority level for this request and any related | 672 // Sets the priority level for this request and any related |
| 673 // jobs. Must not change the priority to anything other than | 673 // jobs. Must not change the priority to anything other than |
| 674 // MAXIMUM_PRIORITY if the IGNORE_LIMITS load flag is set. | 674 // MAXIMUM_PRIORITY if the IGNORE_LIMITS load flag is set. |
| 675 void SetPriority(RequestPriority priority); | 675 void SetPriority(RequestPriority priority); |
| 676 | 676 |
| 677 // Returns true iff this request would be internally redirected to HTTPS | 677 // Returns true iff this request would be internally redirected to HTTPS |
| 678 // due to HSTS. If so, |redirect_url| is rewritten to the new HTTPS URL. | 678 // due to HSTS. If so, |redirect_url| is rewritten to the new HTTPS URL. |
| 679 bool GetHSTSRedirect(GURL* redirect_url) const; | 679 bool GetHSTSRedirect(GURL* redirect_url) const; |
| 680 | 680 |
| 681 // Retries up to |max_retries| times when requests fail with | |
| 682 // ERR_NETWORK_CHANGED. If ERR_NETWORK_CHANGED is received after having | |
| 683 // retried |max_retries| times then it is propagated to the Delegate. | |
| 684 // Retrying is only attempted when ERR_NETWORK_CHANGED is received during | |
| 685 // host resolution or connecting (i.e. before the request has been issued). | |
| 686 // This ensures request side-effects are never duplicated. The default | |
| 687 // number of automatic retries upon ERR_NEWORK_CHANGED is three. This only | |
| 688 // has an effect if the underlying URLRequestJob implements this behavior. | |
| 689 void set_max_automatic_retries_on_network_changes(int max_retries) { | |
| 690 max_automatic_retries_on_network_changes_ = max_retries; | |
| 691 } | |
| 692 int max_automatic_retries_on_network_changes() const { | |
|
mmenke
2014/02/13 20:20:17
Don't think we need an accessor, for now. Not a h
| |
| 693 return max_automatic_retries_on_network_changes_; | |
| 694 } | |
| 695 | |
| 681 // TODO(willchan): Undo this. Only temporarily public. | 696 // TODO(willchan): Undo this. Only temporarily public. |
| 682 bool has_delegate() const { return delegate_ != NULL; } | 697 bool has_delegate() const { return delegate_ != NULL; } |
| 683 | 698 |
| 684 // NOTE(willchan): This is just temporary for debugging | 699 // NOTE(willchan): This is just temporary for debugging |
| 685 // http://crbug.com/90971. | 700 // http://crbug.com/90971. |
| 686 // Allows to setting debug info into the URLRequest. | 701 // Allows to setting debug info into the URLRequest. |
| 687 void set_stack_trace(const base::debug::StackTrace& stack_trace); | 702 void set_stack_trace(const base::debug::StackTrace& stack_trace); |
| 688 const base::debug::StackTrace* stack_trace() const; | 703 const base::debug::StackTrace* stack_trace() const; |
| 689 | 704 |
| 690 void set_received_response_content_length(int64 received_content_length) { | 705 void set_received_response_content_length(int64 received_content_length) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 885 // TODO(battre): Remove this. http://crbug.com/89049 | 900 // TODO(battre): Remove this. http://crbug.com/89049 |
| 886 bool has_notified_completion_; | 901 bool has_notified_completion_; |
| 887 | 902 |
| 888 // Authentication data used by the NetworkDelegate for this request, | 903 // Authentication data used by the NetworkDelegate for this request, |
| 889 // if one is present. |auth_credentials_| may be filled in when calling | 904 // if one is present. |auth_credentials_| may be filled in when calling |
| 890 // |NotifyAuthRequired| on the NetworkDelegate. |auth_info_| holds | 905 // |NotifyAuthRequired| on the NetworkDelegate. |auth_info_| holds |
| 891 // the authentication challenge being handled by |NotifyAuthRequired|. | 906 // the authentication challenge being handled by |NotifyAuthRequired|. |
| 892 AuthCredentials auth_credentials_; | 907 AuthCredentials auth_credentials_; |
| 893 scoped_refptr<AuthChallengeInfo> auth_info_; | 908 scoped_refptr<AuthChallengeInfo> auth_info_; |
| 894 | 909 |
| 910 int max_automatic_retries_on_network_changes_; | |
| 911 | |
| 895 int64 received_response_content_length_; | 912 int64 received_response_content_length_; |
| 896 | 913 |
| 897 base::TimeTicks creation_time_; | 914 base::TimeTicks creation_time_; |
| 898 | 915 |
| 899 // Timing information for the most recent request. Its start times are | 916 // Timing information for the most recent request. Its start times are |
| 900 // populated during Start(), and the rest are populated in OnResponseReceived. | 917 // populated during Start(), and the rest are populated in OnResponseReceived. |
| 901 LoadTimingInfo load_timing_info_; | 918 LoadTimingInfo load_timing_info_; |
| 902 | 919 |
| 903 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 920 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
| 904 | 921 |
| 905 // Keeps track of whether or not OnBeforeNetworkStart has been called yet. | 922 // Keeps track of whether or not OnBeforeNetworkStart has been called yet. |
| 906 bool notified_before_network_start_; | 923 bool notified_before_network_start_; |
| 907 | 924 |
| 908 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 925 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| 909 }; | 926 }; |
| 910 | 927 |
| 911 } // namespace net | 928 } // namespace net |
| 912 | 929 |
| 913 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 930 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |