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_HTTP_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/string16.h" | 15 #include "base/string16.h" |
asanka
2011/10/28 14:39:40
Not needed?
| |
16 #include "base/task.h" | 16 #include "base/task.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
18 #include "net/base/auth.h" | 18 #include "net/base/auth.h" |
19 #include "net/base/completion_callback.h" | 19 #include "net/base/completion_callback.h" |
20 #include "net/base/cookie_store.h" | 20 #include "net/base/cookie_store.h" |
21 #include "net/http/http_request_info.h" | 21 #include "net/http/http_request_info.h" |
22 #include "net/url_request/url_request_job.h" | 22 #include "net/url_request/url_request_job.h" |
23 #include "net/url_request/url_request_throttler_entry_interface.h" | 23 #include "net/url_request/url_request_throttler_entry_interface.h" |
24 | 24 |
25 namespace net { | 25 namespace net { |
(...skipping 29 matching lines...) Expand all Loading... | |
55 | 55 |
56 // Process the Strict-Transport-Security header, if one exists. | 56 // Process the Strict-Transport-Security header, if one exists. |
57 void ProcessStrictTransportSecurityHeader(); | 57 void ProcessStrictTransportSecurityHeader(); |
58 | 58 |
59 // |result| should be net::OK, or the request is canceled. | 59 // |result| should be net::OK, or the request is canceled. |
60 void OnHeadersReceivedCallback(int result); | 60 void OnHeadersReceivedCallback(int result); |
61 void OnStartCompleted(int result); | 61 void OnStartCompleted(int result); |
62 void OnReadCompleted(int result); | 62 void OnReadCompleted(int result); |
63 void NotifyBeforeSendHeadersCallback(int result); | 63 void NotifyBeforeSendHeadersCallback(int result); |
64 | 64 |
65 void RestartTransactionWithAuth(const string16& username, | 65 void RestartTransactionWithAuth(const AuthCredentials& credentials); |
66 const string16& password); | |
67 | 66 |
68 // Overridden from URLRequestJob: | 67 // Overridden from URLRequestJob: |
69 virtual void SetUpload(UploadData* upload) OVERRIDE; | 68 virtual void SetUpload(UploadData* upload) OVERRIDE; |
70 virtual void SetExtraRequestHeaders( | 69 virtual void SetExtraRequestHeaders( |
71 const HttpRequestHeaders& headers) OVERRIDE; | 70 const HttpRequestHeaders& headers) OVERRIDE; |
72 virtual void Start() OVERRIDE; | 71 virtual void Start() OVERRIDE; |
73 virtual void Kill() OVERRIDE; | 72 virtual void Kill() OVERRIDE; |
74 virtual LoadState GetLoadState() const OVERRIDE; | 73 virtual LoadState GetLoadState() const OVERRIDE; |
75 virtual uint64 GetUploadProgress() const OVERRIDE; | 74 virtual uint64 GetUploadProgress() const OVERRIDE; |
76 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; | 75 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; |
77 virtual bool GetCharset(std::string* charset) OVERRIDE; | 76 virtual bool GetCharset(std::string* charset) OVERRIDE; |
78 virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE; | 77 virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE; |
79 virtual bool GetResponseCookies(std::vector<std::string>* cookies) OVERRIDE; | 78 virtual bool GetResponseCookies(std::vector<std::string>* cookies) OVERRIDE; |
80 virtual int GetResponseCode() const OVERRIDE; | 79 virtual int GetResponseCode() const OVERRIDE; |
81 virtual Filter* SetupFilter() const OVERRIDE; | 80 virtual Filter* SetupFilter() const OVERRIDE; |
82 virtual bool IsSafeRedirect(const GURL& location) OVERRIDE; | 81 virtual bool IsSafeRedirect(const GURL& location) OVERRIDE; |
83 virtual bool NeedsAuth() OVERRIDE; | 82 virtual bool NeedsAuth() OVERRIDE; |
84 virtual void GetAuthChallengeInfo(scoped_refptr<AuthChallengeInfo>*) OVERRIDE; | 83 virtual void GetAuthChallengeInfo(scoped_refptr<AuthChallengeInfo>*) OVERRIDE; |
85 virtual void SetAuth(const string16& username, | 84 virtual void SetAuth(const AuthCredentials& credentials) OVERRIDE; |
86 const string16& password) OVERRIDE; | |
87 virtual void CancelAuth() OVERRIDE; | 85 virtual void CancelAuth() OVERRIDE; |
88 virtual void ContinueWithCertificate(X509Certificate* client_cert) OVERRIDE; | 86 virtual void ContinueWithCertificate(X509Certificate* client_cert) OVERRIDE; |
89 virtual void ContinueDespiteLastError() OVERRIDE; | 87 virtual void ContinueDespiteLastError() OVERRIDE; |
90 virtual bool ReadRawData(IOBuffer* buf, int buf_size, | 88 virtual bool ReadRawData(IOBuffer* buf, int buf_size, |
91 int *bytes_read) OVERRIDE; | 89 int *bytes_read) OVERRIDE; |
92 virtual void StopCaching() OVERRIDE; | 90 virtual void StopCaching() OVERRIDE; |
93 virtual void DoneReading() OVERRIDE; | 91 virtual void DoneReading() OVERRIDE; |
94 virtual HostPortPair GetSocketAddress() const OVERRIDE; | 92 virtual HostPortPair GetSocketAddress() const OVERRIDE; |
95 virtual void NotifyURLRequestDestroyed() OVERRIDE; | 93 virtual void NotifyURLRequestDestroyed() OVERRIDE; |
96 | 94 |
97 // Keep a reference to the url request context to be sure it's not deleted | 95 // Keep a reference to the url request context to be sure it's not deleted |
98 // before us. | 96 // before us. |
99 scoped_refptr<const URLRequestContext> context_; | 97 scoped_refptr<const URLRequestContext> context_; |
100 | 98 |
101 HttpRequestInfo request_info_; | 99 HttpRequestInfo request_info_; |
102 const HttpResponseInfo* response_info_; | 100 const HttpResponseInfo* response_info_; |
103 | 101 |
104 std::vector<std::string> response_cookies_; | 102 std::vector<std::string> response_cookies_; |
105 size_t response_cookies_save_index_; | 103 size_t response_cookies_save_index_; |
106 | 104 |
107 // Auth states for proxy and origin server. | 105 // Auth states for proxy and origin server. |
108 AuthState proxy_auth_state_; | 106 AuthState proxy_auth_state_; |
109 AuthState server_auth_state_; | 107 AuthState server_auth_state_; |
110 | 108 AuthCredentials auth_credentials_; |
111 string16 username_; | |
112 string16 password_; | |
113 | 109 |
114 OldCompletionCallbackImpl<URLRequestHttpJob> start_callback_; | 110 OldCompletionCallbackImpl<URLRequestHttpJob> start_callback_; |
115 OldCompletionCallbackImpl<URLRequestHttpJob> read_callback_; | 111 OldCompletionCallbackImpl<URLRequestHttpJob> read_callback_; |
116 OldCompletionCallbackImpl<URLRequestHttpJob> | 112 OldCompletionCallbackImpl<URLRequestHttpJob> |
117 notify_before_headers_sent_callback_; | 113 notify_before_headers_sent_callback_; |
118 | 114 |
119 bool read_in_progress_; | 115 bool read_in_progress_; |
120 | 116 |
121 // An URL for an SDCH dictionary as suggested in a Get-Dictionary HTTP header. | 117 // An URL for an SDCH dictionary as suggested in a Get-Dictionary HTTP header. |
122 GURL sdch_dictionary_url_; | 118 GURL sdch_dictionary_url_; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, | 229 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, |
234 // to inform the NetworkDelegate that it may not call back. | 230 // to inform the NetworkDelegate that it may not call back. |
235 bool awaiting_callback_; | 231 bool awaiting_callback_; |
236 | 232 |
237 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); | 233 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); |
238 }; | 234 }; |
239 | 235 |
240 } // namespace net | 236 } // namespace net |
241 | 237 |
242 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 238 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
OLD | NEW |