| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/debug/leak_tracker.h" | 13 #include "base/debug/leak_tracker.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/memory/linked_ptr.h" | 15 #include "base/memory/linked_ptr.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/string16.h" | 17 #include "base/string16.h" |
| 18 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
| 19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 20 #include "net/base/auth.h" |
| 20 #include "net/base/completion_callback.h" | 21 #include "net/base/completion_callback.h" |
| 21 #include "net/base/load_states.h" | 22 #include "net/base/load_states.h" |
| 22 #include "net/base/net_export.h" | 23 #include "net/base/net_export.h" |
| 23 #include "net/base/net_log.h" | 24 #include "net/base/net_log.h" |
| 24 #include "net/base/request_priority.h" | 25 #include "net/base/request_priority.h" |
| 25 #include "net/http/http_request_headers.h" | 26 #include "net/http/http_request_headers.h" |
| 26 #include "net/http/http_response_info.h" | 27 #include "net/http/http_response_info.h" |
| 27 #include "net/url_request/url_request_status.h" | 28 #include "net/url_request/url_request_status.h" |
| 28 | 29 |
| 29 class FilePath; | 30 class FilePath; |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 // Called by URLRequestJob to allow interception when the final response | 706 // Called by URLRequestJob to allow interception when the final response |
| 706 // occurs. | 707 // occurs. |
| 707 void NotifyResponseStarted(); | 708 void NotifyResponseStarted(); |
| 708 | 709 |
| 709 bool has_delegate() const { return delegate_ != NULL; } | 710 bool has_delegate() const { return delegate_ != NULL; } |
| 710 | 711 |
| 711 // These functions delegate to |delegate_| and may only be used if | 712 // These functions delegate to |delegate_| and may only be used if |
| 712 // |delegate_| is not NULL. See URLRequest::Delegate for the meaning | 713 // |delegate_| is not NULL. See URLRequest::Delegate for the meaning |
| 713 // of these functions. | 714 // of these functions. |
| 714 void NotifyAuthRequired(AuthChallengeInfo* auth_info); | 715 void NotifyAuthRequired(AuthChallengeInfo* auth_info); |
| 716 void NotifyAuthRequiredComplete(int result); |
| 715 void NotifyCertificateRequested(SSLCertRequestInfo* cert_request_info); | 717 void NotifyCertificateRequested(SSLCertRequestInfo* cert_request_info); |
| 716 void NotifySSLCertificateError(int cert_error, X509Certificate* cert); | 718 void NotifySSLCertificateError(int cert_error, X509Certificate* cert); |
| 717 bool CanGetCookies(const CookieList& cookie_list) const; | 719 bool CanGetCookies(const CookieList& cookie_list) const; |
| 718 bool CanSetCookie(const std::string& cookie_line, | 720 bool CanSetCookie(const std::string& cookie_line, |
| 719 CookieOptions* options) const; | 721 CookieOptions* options) const; |
| 720 void NotifyReadCompleted(int bytes_read); | 722 void NotifyReadCompleted(int bytes_read); |
| 721 | 723 |
| 722 // Called when the delegate blocks or unblocks this request when intercepting | 724 // Called when the delegate blocks or unblocks this request when intercepting |
| 723 // certain requests. | 725 // certain requests. |
| 724 void SetBlockedOnDelegate(); | 726 void SetBlockedOnDelegate(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 | 798 |
| 797 // Callback passed to the network delegate to notify us when a blocked request | 799 // Callback passed to the network delegate to notify us when a blocked request |
| 798 // is ready to be resumed or canceled. | 800 // is ready to be resumed or canceled. |
| 799 CompletionCallbackImpl<URLRequest> before_request_callback_; | 801 CompletionCallbackImpl<URLRequest> before_request_callback_; |
| 800 | 802 |
| 801 // Safe-guard to ensure that we do not send multiple "I am completed" | 803 // Safe-guard to ensure that we do not send multiple "I am completed" |
| 802 // messages to network delegate. | 804 // messages to network delegate. |
| 803 // TODO(battre): Remove this. http://crbug.com/89049 | 805 // TODO(battre): Remove this. http://crbug.com/89049 |
| 804 bool has_notified_completion_; | 806 bool has_notified_completion_; |
| 805 | 807 |
| 808 // Go out to the extension to see things. |
| 809 AuthCredentials auth_credentials_; |
| 810 CompletionCallbackImpl<URLRequest> auth_required_callback_; |
| 811 scoped_refptr<AuthChallengeInfo> auth_info_; |
| 812 |
| 806 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 813 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| 807 }; | 814 }; |
| 808 | 815 |
| 809 } // namespace net | 816 } // namespace net |
| 810 | 817 |
| 811 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 818 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |