| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 // URLRequest to ignore the current error and continue with the request. To | 596 // URLRequest to ignore the current error and continue with the request. To |
| 597 // cancel the request instead, call Cancel(). | 597 // cancel the request instead, call Cancel(). |
| 598 void ContinueDespiteLastError(); | 598 void ContinueDespiteLastError(); |
| 599 | 599 |
| 600 // Used to specify the context (cookie store, cache) for this request. | 600 // Used to specify the context (cookie store, cache) for this request. |
| 601 const URLRequestContext* context() const; | 601 const URLRequestContext* context() const; |
| 602 | 602 |
| 603 const BoundNetLog& net_log() const { return net_log_; } | 603 const BoundNetLog& net_log() const { return net_log_; } |
| 604 | 604 |
| 605 // Returns the expected content size if available | 605 // Returns the expected content size if available |
| 606 int64 GetExpectedContentSize() const; | 606 int64_t GetExpectedContentSize() const; |
| 607 | 607 |
| 608 // Returns the priority level for this request. | 608 // Returns the priority level for this request. |
| 609 RequestPriority priority() const { return priority_; } | 609 RequestPriority priority() const { return priority_; } |
| 610 | 610 |
| 611 // Sets the priority level for this request and any related | 611 // Sets the priority level for this request and any related |
| 612 // jobs. Must not change the priority to anything other than | 612 // jobs. Must not change the priority to anything other than |
| 613 // MAXIMUM_PRIORITY if the IGNORE_LIMITS load flag is set. | 613 // MAXIMUM_PRIORITY if the IGNORE_LIMITS load flag is set. |
| 614 void SetPriority(RequestPriority priority); | 614 void SetPriority(RequestPriority priority); |
| 615 | 615 |
| 616 // Returns true iff this request would be internally redirected to HTTPS | 616 // Returns true iff this request would be internally redirected to HTTPS |
| 617 // due to HSTS. If so, |redirect_url| is rewritten to the new HTTPS URL. | 617 // due to HSTS. If so, |redirect_url| is rewritten to the new HTTPS URL. |
| 618 bool GetHSTSRedirect(GURL* redirect_url) const; | 618 bool GetHSTSRedirect(GURL* redirect_url) const; |
| 619 | 619 |
| 620 // TODO(willchan): Undo this. Only temporarily public. | 620 // TODO(willchan): Undo this. Only temporarily public. |
| 621 bool has_delegate() const { return delegate_ != NULL; } | 621 bool has_delegate() const { return delegate_ != NULL; } |
| 622 | 622 |
| 623 // NOTE(willchan): This is just temporary for debugging | 623 // NOTE(willchan): This is just temporary for debugging |
| 624 // http://crbug.com/90971. | 624 // http://crbug.com/90971. |
| 625 // Allows to setting debug info into the URLRequest. | 625 // Allows to setting debug info into the URLRequest. |
| 626 void set_stack_trace(const base::debug::StackTrace& stack_trace); | 626 void set_stack_trace(const base::debug::StackTrace& stack_trace); |
| 627 const base::debug::StackTrace* stack_trace() const; | 627 const base::debug::StackTrace* stack_trace() const; |
| 628 | 628 |
| 629 void set_received_response_content_length(int64 received_content_length) { | 629 void set_received_response_content_length(int64_t received_content_length) { |
| 630 received_response_content_length_ = received_content_length; | 630 received_response_content_length_ = received_content_length; |
| 631 } | 631 } |
| 632 | 632 |
| 633 // The number of bytes in the raw response body (before any decompression, | 633 // The number of bytes in the raw response body (before any decompression, |
| 634 // etc.). This is only available after the final Read completes. Not available | 634 // etc.). This is only available after the final Read completes. Not available |
| 635 // for FTP responses. | 635 // for FTP responses. |
| 636 int64 received_response_content_length() const { | 636 int64_t received_response_content_length() const { |
| 637 return received_response_content_length_; | 637 return received_response_content_length_; |
| 638 } | 638 } |
| 639 | 639 |
| 640 // Available at NetworkDelegate::NotifyHeadersReceived() time, which is before | 640 // Available at NetworkDelegate::NotifyHeadersReceived() time, which is before |
| 641 // the more general response_info() is available, even though it is a subset. | 641 // the more general response_info() is available, even though it is a subset. |
| 642 const HostPortPair& proxy_server() const { | 642 const HostPortPair& proxy_server() const { |
| 643 return proxy_server_; | 643 return proxy_server_; |
| 644 } | 644 } |
| 645 | 645 |
| 646 // Gets the connection attempts made in the process of servicing this | 646 // Gets the connection attempts made in the process of servicing this |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 // allocate sockets to first. | 806 // allocate sockets to first. |
| 807 RequestPriority priority_; | 807 RequestPriority priority_; |
| 808 | 808 |
| 809 // TODO(battre): The only consumer of the identifier_ is currently the | 809 // TODO(battre): The only consumer of the identifier_ is currently the |
| 810 // web request API. We need to match identifiers of requests between the | 810 // web request API. We need to match identifiers of requests between the |
| 811 // web request API and the web navigation API. As the URLRequest does not | 811 // web request API and the web navigation API. As the URLRequest does not |
| 812 // exist when the web navigation API is triggered, the tracking probably | 812 // exist when the web navigation API is triggered, the tracking probably |
| 813 // needs to be done outside of the URLRequest anyway. Therefore, this | 813 // needs to be done outside of the URLRequest anyway. Therefore, this |
| 814 // identifier should be deleted here. http://crbug.com/89321 | 814 // identifier should be deleted here. http://crbug.com/89321 |
| 815 // A globally unique identifier for this request. | 815 // A globally unique identifier for this request. |
| 816 const uint64 identifier_; | 816 const uint64_t identifier_; |
| 817 | 817 |
| 818 // True if this request is currently calling a delegate, or is blocked waiting | 818 // True if this request is currently calling a delegate, or is blocked waiting |
| 819 // for the URL request or network delegate to resume it. | 819 // for the URL request or network delegate to resume it. |
| 820 bool calling_delegate_; | 820 bool calling_delegate_; |
| 821 | 821 |
| 822 // An optional parameter that provides additional information about what | 822 // An optional parameter that provides additional information about what |
| 823 // |this| is currently being blocked by. | 823 // |this| is currently being blocked by. |
| 824 std::string blocked_by_; | 824 std::string blocked_by_; |
| 825 bool use_blocked_by_as_load_param_; | 825 bool use_blocked_by_as_load_param_; |
| 826 | 826 |
| 827 base::debug::LeakTracker<URLRequest> leak_tracker_; | 827 base::debug::LeakTracker<URLRequest> leak_tracker_; |
| 828 | 828 |
| 829 // Callback passed to the network delegate to notify us when a blocked request | 829 // Callback passed to the network delegate to notify us when a blocked request |
| 830 // is ready to be resumed or canceled. | 830 // is ready to be resumed or canceled. |
| 831 CompletionCallback before_request_callback_; | 831 CompletionCallback before_request_callback_; |
| 832 | 832 |
| 833 // Safe-guard to ensure that we do not send multiple "I am completed" | 833 // Safe-guard to ensure that we do not send multiple "I am completed" |
| 834 // messages to network delegate. | 834 // messages to network delegate. |
| 835 // TODO(battre): Remove this. http://crbug.com/89049 | 835 // TODO(battre): Remove this. http://crbug.com/89049 |
| 836 bool has_notified_completion_; | 836 bool has_notified_completion_; |
| 837 | 837 |
| 838 // Authentication data used by the NetworkDelegate for this request, | 838 // Authentication data used by the NetworkDelegate for this request, |
| 839 // if one is present. |auth_credentials_| may be filled in when calling | 839 // if one is present. |auth_credentials_| may be filled in when calling |
| 840 // |NotifyAuthRequired| on the NetworkDelegate. |auth_info_| holds | 840 // |NotifyAuthRequired| on the NetworkDelegate. |auth_info_| holds |
| 841 // the authentication challenge being handled by |NotifyAuthRequired|. | 841 // the authentication challenge being handled by |NotifyAuthRequired|. |
| 842 AuthCredentials auth_credentials_; | 842 AuthCredentials auth_credentials_; |
| 843 scoped_refptr<AuthChallengeInfo> auth_info_; | 843 scoped_refptr<AuthChallengeInfo> auth_info_; |
| 844 | 844 |
| 845 int64 received_response_content_length_; | 845 int64_t received_response_content_length_; |
| 846 | 846 |
| 847 base::TimeTicks creation_time_; | 847 base::TimeTicks creation_time_; |
| 848 | 848 |
| 849 // Timing information for the most recent request. Its start times are | 849 // Timing information for the most recent request. Its start times are |
| 850 // populated during Start(), and the rest are populated in OnResponseReceived. | 850 // populated during Start(), and the rest are populated in OnResponseReceived. |
| 851 LoadTimingInfo load_timing_info_; | 851 LoadTimingInfo load_timing_info_; |
| 852 | 852 |
| 853 // Keeps track of whether or not OnBeforeNetworkStart has been called yet. | 853 // Keeps track of whether or not OnBeforeNetworkStart has been called yet. |
| 854 bool notified_before_network_start_; | 854 bool notified_before_network_start_; |
| 855 | 855 |
| 856 // The proxy server used for this request, if any. | 856 // The proxy server used for this request, if any. |
| 857 HostPortPair proxy_server_; | 857 HostPortPair proxy_server_; |
| 858 | 858 |
| 859 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 859 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
| 860 | 860 |
| 861 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 861 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| 862 }; | 862 }; |
| 863 | 863 |
| 864 } // namespace net | 864 } // namespace net |
| 865 | 865 |
| 866 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 866 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |