Chromium Code Reviews| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 PATTERN_UNDEFINED, | 239 PATTERN_UNDEFINED, |
| 240 PATTERN_NOT_COVERED, | 240 PATTERN_NOT_COVERED, |
| 241 PATTERN_ENTRY_NOT_CACHED, | 241 PATTERN_ENTRY_NOT_CACHED, |
| 242 PATTERN_ENTRY_USED, | 242 PATTERN_ENTRY_USED, |
| 243 PATTERN_ENTRY_VALIDATED, | 243 PATTERN_ENTRY_VALIDATED, |
| 244 PATTERN_ENTRY_UPDATED, | 244 PATTERN_ENTRY_UPDATED, |
| 245 PATTERN_ENTRY_CANT_CONDITIONALIZE, | 245 PATTERN_ENTRY_CANT_CONDITIONALIZE, |
| 246 PATTERN_MAX, | 246 PATTERN_MAX, |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 // Used for categorizing validation triggers in histograms. | |
| 250 // NOTE: This enumeration is used in histograms, so please do not add entries | |
| 251 // in the middle. | |
| 252 enum ValidationCause { | |
|
gavinp
2016/05/12 15:02:02
Could we use an enum class here?
jkarlin
2016/05/13 15:06:51
We could, but we'd still have to static_cast the h
| |
| 253 VALIDATION_CAUSE_UNDEFINED, | |
| 254 VALIDATION_CAUSE_VARY_MISMATCH, | |
| 255 VALIDATION_CAUSE_VALIDATE_FLAG, | |
| 256 VALIDATION_CAUSE_STALE, | |
| 257 VALIDATION_CAUSE_ZERO_FRESHNESS, | |
| 258 VALIDATION_CAUSE_MAX | |
| 259 }; | |
| 260 | |
| 249 // Runs the state transition loop. Resets and calls |callback_| on exit, | 261 // Runs the state transition loop. Resets and calls |callback_| on exit, |
| 250 // unless the return value is ERR_IO_PENDING. | 262 // unless the return value is ERR_IO_PENDING. |
| 251 int DoLoop(int result); | 263 int DoLoop(int result); |
| 252 | 264 |
| 253 // Each of these methods corresponds to a State value. If there is an | 265 // Each of these methods corresponds to a State value. If there is an |
| 254 // argument, the value corresponds to the return of the previous state or | 266 // argument, the value corresponds to the return of the previous state or |
| 255 // corresponding callback. | 267 // corresponding callback. |
| 256 int DoGetBackend(); | 268 int DoGetBackend(); |
| 257 int DoGetBackendComplete(int result); | 269 int DoGetBackendComplete(int result); |
| 258 int DoInitEntry(); | 270 int DoInitEntry(); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 461 int io_buf_len_; | 473 int io_buf_len_; |
| 462 int read_offset_; | 474 int read_offset_; |
| 463 int effective_load_flags_; | 475 int effective_load_flags_; |
| 464 int write_len_; | 476 int write_len_; |
| 465 std::unique_ptr<PartialData> partial_; // We are dealing with range requests. | 477 std::unique_ptr<PartialData> partial_; // We are dealing with range requests. |
| 466 UploadProgress final_upload_progress_; | 478 UploadProgress final_upload_progress_; |
| 467 CompletionCallback io_callback_; | 479 CompletionCallback io_callback_; |
| 468 | 480 |
| 469 // Members used to track data for histograms. | 481 // Members used to track data for histograms. |
| 470 TransactionPattern transaction_pattern_; | 482 TransactionPattern transaction_pattern_; |
| 483 ValidationCause validation_cause_; | |
| 471 base::TimeTicks entry_lock_waiting_since_; | 484 base::TimeTicks entry_lock_waiting_since_; |
| 472 base::TimeTicks first_cache_access_since_; | 485 base::TimeTicks first_cache_access_since_; |
| 473 base::TimeTicks send_request_since_; | 486 base::TimeTicks send_request_since_; |
| 474 | 487 |
| 475 int64_t total_received_bytes_; | 488 int64_t total_received_bytes_; |
| 476 int64_t total_sent_bytes_; | 489 int64_t total_sent_bytes_; |
| 477 | 490 |
| 478 // Load timing information for the last network request, if any. Set in the | 491 // Load timing information for the last network request, if any. Set in the |
| 479 // 304 and 206 response cases, as the network transaction may be destroyed | 492 // 304 and 206 response cases, as the network transaction may be destroyed |
| 480 // before the caller requests load timing information. | 493 // before the caller requests load timing information. |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 494 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_; | 507 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_; |
| 495 | 508 |
| 496 base::WeakPtrFactory<Transaction> weak_factory_; | 509 base::WeakPtrFactory<Transaction> weak_factory_; |
| 497 | 510 |
| 498 DISALLOW_COPY_AND_ASSIGN(Transaction); | 511 DISALLOW_COPY_AND_ASSIGN(Transaction); |
| 499 }; | 512 }; |
| 500 | 513 |
| 501 } // namespace net | 514 } // namespace net |
| 502 | 515 |
| 503 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 516 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
| OLD | NEW |