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 // This file declares HttpCache::Transaction, a private class of HttpCache so | 5 // This file declares HttpCache::Transaction, a private class of HttpCache so |
6 // it should only be included by http_cache.cc | 6 // it should only be included by http_cache.cc |
7 | 7 |
8 #ifndef NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 8 #ifndef NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
9 #define NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 9 #define NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
10 #pragma once | 10 #pragma once |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/string16.h" | |
15 #include "base/time.h" | 14 #include "base/time.h" |
16 #include "net/base/net_log.h" | 15 #include "net/base/net_log.h" |
17 #include "net/http/http_cache.h" | 16 #include "net/http/http_cache.h" |
18 #include "net/http/http_response_info.h" | 17 #include "net/http/http_response_info.h" |
19 #include "net/http/http_request_headers.h" | 18 #include "net/http/http_request_headers.h" |
20 #include "net/http/http_transaction.h" | 19 #include "net/http/http_transaction.h" |
21 | 20 |
22 namespace net { | 21 namespace net { |
23 | 22 |
24 class HttpResponseHeaders; | 23 class HttpResponseHeaders; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 OldCompletionCallback* io_callback() { return &io_callback_; } | 95 OldCompletionCallback* io_callback() { return &io_callback_; } |
97 | 96 |
98 const BoundNetLog& net_log() const; | 97 const BoundNetLog& net_log() const; |
99 | 98 |
100 // HttpTransaction methods: | 99 // HttpTransaction methods: |
101 virtual int Start(const HttpRequestInfo*, OldCompletionCallback*, | 100 virtual int Start(const HttpRequestInfo*, OldCompletionCallback*, |
102 const BoundNetLog&); | 101 const BoundNetLog&); |
103 virtual int RestartIgnoringLastError(OldCompletionCallback* callback); | 102 virtual int RestartIgnoringLastError(OldCompletionCallback* callback); |
104 virtual int RestartWithCertificate(X509Certificate* client_cert, | 103 virtual int RestartWithCertificate(X509Certificate* client_cert, |
105 OldCompletionCallback* callback); | 104 OldCompletionCallback* callback); |
106 virtual int RestartWithAuth(const string16& username, | 105 virtual int RestartWithAuth(const AuthCredentials& credentials, |
107 const string16& password, | |
108 OldCompletionCallback* callback); | 106 OldCompletionCallback* callback); |
109 virtual bool IsReadyToRestartForAuth(); | 107 virtual bool IsReadyToRestartForAuth(); |
110 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); | 108 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); |
111 virtual void StopCaching(); | 109 virtual void StopCaching(); |
112 virtual void DoneReading(); | 110 virtual void DoneReading(); |
113 virtual const HttpResponseInfo* GetResponseInfo() const; | 111 virtual const HttpResponseInfo* GetResponseInfo() const; |
114 virtual LoadState GetLoadState() const; | 112 virtual LoadState GetLoadState() const; |
115 virtual uint64 GetUploadProgress(void) const; | 113 virtual uint64 GetUploadProgress(void) const; |
116 | 114 |
117 private: | 115 private: |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // Called to restart a network transaction after an error. Returns network | 249 // Called to restart a network transaction after an error. Returns network |
252 // error code. | 250 // error code. |
253 int RestartNetworkRequest(); | 251 int RestartNetworkRequest(); |
254 | 252 |
255 // Called to restart a network transaction with a client certificate. | 253 // Called to restart a network transaction with a client certificate. |
256 // Returns network error code. | 254 // Returns network error code. |
257 int RestartNetworkRequestWithCertificate(X509Certificate* client_cert); | 255 int RestartNetworkRequestWithCertificate(X509Certificate* client_cert); |
258 | 256 |
259 // Called to restart a network transaction with authentication credentials. | 257 // Called to restart a network transaction with authentication credentials. |
260 // Returns network error code. | 258 // Returns network error code. |
261 int RestartNetworkRequestWithAuth(const string16& username, | 259 int RestartNetworkRequestWithAuth(const AuthCredentials& credentials); |
262 const string16& password); | |
263 | 260 |
264 // Called to determine if we need to validate the cache entry before using it. | 261 // Called to determine if we need to validate the cache entry before using it. |
265 bool RequiresValidation(); | 262 bool RequiresValidation(); |
266 | 263 |
267 // Called to make the request conditional (to ask the server if the cached | 264 // Called to make the request conditional (to ask the server if the cached |
268 // copy is valid). Returns true if able to make the request conditional. | 265 // copy is valid). Returns true if able to make the request conditional. |
269 bool ConditionalizeRequest(); | 266 bool ConditionalizeRequest(); |
270 | 267 |
271 // Makes sure that a 206 response is expected. Returns true on success. | 268 // Makes sure that a 206 response is expected. Returns true on success. |
272 // On success, handling_206_ will be set to true if we are processing a | 269 // On success, handling_206_ will be set to true if we are processing a |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 uint64 final_upload_progress_; | 358 uint64 final_upload_progress_; |
362 OldCompletionCallbackImpl<Transaction> io_callback_; | 359 OldCompletionCallbackImpl<Transaction> io_callback_; |
363 scoped_refptr<CancelableOldCompletionCallback<Transaction> > cache_callback_; | 360 scoped_refptr<CancelableOldCompletionCallback<Transaction> > cache_callback_; |
364 scoped_refptr<CancelableOldCompletionCallback<Transaction> > | 361 scoped_refptr<CancelableOldCompletionCallback<Transaction> > |
365 write_headers_callback_; | 362 write_headers_callback_; |
366 }; | 363 }; |
367 | 364 |
368 } // namespace net | 365 } // namespace net |
369 | 366 |
370 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 367 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
OLD | NEW |