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