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 // 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 | 10 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 STATE_UPDATE_CACHED_RESPONSE, | 174 STATE_UPDATE_CACHED_RESPONSE, |
175 STATE_UPDATE_CACHED_RESPONSE_COMPLETE, | 175 STATE_UPDATE_CACHED_RESPONSE_COMPLETE, |
176 STATE_OVERWRITE_CACHED_RESPONSE, | 176 STATE_OVERWRITE_CACHED_RESPONSE, |
177 STATE_TRUNCATE_CACHED_DATA, | 177 STATE_TRUNCATE_CACHED_DATA, |
178 STATE_TRUNCATE_CACHED_DATA_COMPLETE, | 178 STATE_TRUNCATE_CACHED_DATA_COMPLETE, |
179 STATE_TRUNCATE_CACHED_METADATA, | 179 STATE_TRUNCATE_CACHED_METADATA, |
180 STATE_TRUNCATE_CACHED_METADATA_COMPLETE, | 180 STATE_TRUNCATE_CACHED_METADATA_COMPLETE, |
181 STATE_PARTIAL_HEADERS_RECEIVED, | 181 STATE_PARTIAL_HEADERS_RECEIVED, |
182 STATE_CACHE_READ_RESPONSE, | 182 STATE_CACHE_READ_RESPONSE, |
183 STATE_CACHE_READ_RESPONSE_COMPLETE, | 183 STATE_CACHE_READ_RESPONSE_COMPLETE, |
| 184 STATE_TOGGLE_UNUSED_SINCE_PREFETCH, |
| 185 STATE_TOGGLE_UNUSED_SINCE_PREFETCH_COMPLETE, |
184 STATE_CACHE_WRITE_RESPONSE, | 186 STATE_CACHE_WRITE_RESPONSE, |
185 STATE_CACHE_WRITE_TRUNCATED_RESPONSE, | 187 STATE_CACHE_WRITE_TRUNCATED_RESPONSE, |
186 STATE_CACHE_WRITE_RESPONSE_COMPLETE, | 188 STATE_CACHE_WRITE_RESPONSE_COMPLETE, |
187 STATE_CACHE_READ_METADATA, | 189 STATE_CACHE_READ_METADATA, |
188 STATE_CACHE_READ_METADATA_COMPLETE, | 190 STATE_CACHE_READ_METADATA_COMPLETE, |
189 STATE_CACHE_QUERY_DATA, | 191 STATE_CACHE_QUERY_DATA, |
190 STATE_CACHE_QUERY_DATA_COMPLETE, | 192 STATE_CACHE_QUERY_DATA_COMPLETE, |
191 STATE_CACHE_READ_DATA, | 193 STATE_CACHE_READ_DATA, |
192 STATE_CACHE_READ_DATA_COMPLETE, | 194 STATE_CACHE_READ_DATA_COMPLETE, |
193 STATE_CACHE_WRITE_DATA, | 195 STATE_CACHE_WRITE_DATA, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 int DoUpdateCachedResponse(); | 247 int DoUpdateCachedResponse(); |
246 int DoUpdateCachedResponseComplete(int result); | 248 int DoUpdateCachedResponseComplete(int result); |
247 int DoOverwriteCachedResponse(); | 249 int DoOverwriteCachedResponse(); |
248 int DoTruncateCachedData(); | 250 int DoTruncateCachedData(); |
249 int DoTruncateCachedDataComplete(int result); | 251 int DoTruncateCachedDataComplete(int result); |
250 int DoTruncateCachedMetadata(); | 252 int DoTruncateCachedMetadata(); |
251 int DoTruncateCachedMetadataComplete(int result); | 253 int DoTruncateCachedMetadataComplete(int result); |
252 int DoPartialHeadersReceived(); | 254 int DoPartialHeadersReceived(); |
253 int DoCacheReadResponse(); | 255 int DoCacheReadResponse(); |
254 int DoCacheReadResponseComplete(int result); | 256 int DoCacheReadResponseComplete(int result); |
| 257 int DoCacheToggleUnusedSincePrefetch(); |
| 258 int DoCacheToggleUnusedSincePrefetchComplete(int result); |
255 int DoCacheWriteResponse(); | 259 int DoCacheWriteResponse(); |
256 int DoCacheWriteTruncatedResponse(); | 260 int DoCacheWriteTruncatedResponse(); |
257 int DoCacheWriteResponseComplete(int result); | 261 int DoCacheWriteResponseComplete(int result); |
258 int DoCacheReadMetadata(); | 262 int DoCacheReadMetadata(); |
259 int DoCacheReadMetadataComplete(int result); | 263 int DoCacheReadMetadataComplete(int result); |
260 int DoCacheQueryData(); | 264 int DoCacheQueryData(); |
261 int DoCacheQueryDataComplete(int result); | 265 int DoCacheQueryDataComplete(int result); |
262 int DoCacheReadData(); | 266 int DoCacheReadData(); |
263 int DoCacheReadDataComplete(int result); | 267 int DoCacheReadDataComplete(int result); |
264 int DoCacheWriteData(int num_bytes); | 268 int DoCacheWriteData(int num_bytes); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 // transaction should be restarted. | 370 // transaction should be restarted. |
367 int OnCacheReadError(int result, bool restart); | 371 int OnCacheReadError(int result, bool restart); |
368 | 372 |
369 // Called when the cache lock timeout fires. | 373 // Called when the cache lock timeout fires. |
370 void OnAddToEntryTimeout(base::TimeTicks start_time); | 374 void OnAddToEntryTimeout(base::TimeTicks start_time); |
371 | 375 |
372 // Deletes the current partial cache entry (sparse), and optionally removes | 376 // Deletes the current partial cache entry (sparse), and optionally removes |
373 // the control object (partial_). | 377 // the control object (partial_). |
374 void DoomPartialEntry(bool delete_object); | 378 void DoomPartialEntry(bool delete_object); |
375 | 379 |
| 380 // Determines the next state to move to after reading a response from the |
| 381 // cache based on the (mode_). |
| 382 int DoCacheReadResponseCompleteContinuation(); |
| 383 |
376 // Performs the needed work after receiving data from the network, when | 384 // Performs the needed work after receiving data from the network, when |
377 // working with range requests. | 385 // working with range requests. |
378 int DoPartialNetworkReadCompleted(int result); | 386 int DoPartialNetworkReadCompleted(int result); |
379 | 387 |
380 // Performs the needed work after receiving data from the cache, when | 388 // Performs the needed work after receiving data from the cache, when |
381 // working with range requests. | 389 // working with range requests. |
382 int DoPartialCacheReadCompleted(int result); | 390 int DoPartialCacheReadCompleted(int result); |
383 | 391 |
384 // Restarts this transaction after deleting the cached data. It is meant to | 392 // Restarts this transaction after deleting the cached data. It is meant to |
385 // be used when the current request cannot be fulfilled due to conflicts | 393 // be used when the current request cannot be fulfilled due to conflicts |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_; | 473 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_; |
466 | 474 |
467 base::WeakPtrFactory<Transaction> weak_factory_; | 475 base::WeakPtrFactory<Transaction> weak_factory_; |
468 | 476 |
469 DISALLOW_COPY_AND_ASSIGN(Transaction); | 477 DISALLOW_COPY_AND_ASSIGN(Transaction); |
470 }; | 478 }; |
471 | 479 |
472 } // namespace net | 480 } // namespace net |
473 | 481 |
474 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 482 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
OLD | NEW |