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