Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Side by Side Diff: net/http/http_cache_transaction.h

Issue 2774603003: Doom and create new entry when validation is not a match (Closed)
Patch Set: Rebased with refs/heads/master@{#484325} Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_cache.cc ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 const BeforeNetworkStartCallback& callback) override; 169 const BeforeNetworkStartCallback& callback) override;
170 void SetBeforeHeadersSentCallback( 170 void SetBeforeHeadersSentCallback(
171 const BeforeHeadersSentCallback& callback) override; 171 const BeforeHeadersSentCallback& callback) override;
172 int ResumeNetworkStart() override; 172 int ResumeNetworkStart() override;
173 void GetConnectionAttempts(ConnectionAttempts* out) const override; 173 void GetConnectionAttempts(ConnectionAttempts* out) const override;
174 174
175 // Invoked when parallel validation cannot proceed due to response failure 175 // Invoked when parallel validation cannot proceed due to response failure
176 // and this transaction needs to be restarted. 176 // and this transaction needs to be restarted.
177 void SetValidatingCannotProceed(); 177 void SetValidatingCannotProceed();
178 178
179 // Invoked to remove the association between a transaction waiting to be
180 // added to an entry and the entry.
181 void ResetCachePendingState() { cache_pending_ = false; }
182
179 // Returns the estimate of dynamically allocated memory in bytes. 183 // Returns the estimate of dynamically allocated memory in bytes.
180 size_t EstimateMemoryUsage() const; 184 size_t EstimateMemoryUsage() const;
181 185
182 private: 186 private:
183 static const size_t kNumValidationHeaders = 2; 187 static const size_t kNumValidationHeaders = 2;
184 // Helper struct to pair a header name with its value, for 188 // Helper struct to pair a header name with its value, for
185 // headers used to validate cache entries. 189 // headers used to validate cache entries.
186 struct ValidationHeaders { 190 struct ValidationHeaders {
187 ValidationHeaders() : initialized(false) {} 191 ValidationHeaders() : initialized(false) {}
188 192
(...skipping 15 matching lines...) Expand all
204 STATE_GET_BACKEND_COMPLETE, 208 STATE_GET_BACKEND_COMPLETE,
205 STATE_INIT_ENTRY, 209 STATE_INIT_ENTRY,
206 STATE_OPEN_ENTRY, 210 STATE_OPEN_ENTRY,
207 STATE_OPEN_ENTRY_COMPLETE, 211 STATE_OPEN_ENTRY_COMPLETE,
208 STATE_DOOM_ENTRY, 212 STATE_DOOM_ENTRY,
209 STATE_DOOM_ENTRY_COMPLETE, 213 STATE_DOOM_ENTRY_COMPLETE,
210 STATE_CREATE_ENTRY, 214 STATE_CREATE_ENTRY,
211 STATE_CREATE_ENTRY_COMPLETE, 215 STATE_CREATE_ENTRY_COMPLETE,
212 STATE_ADD_TO_ENTRY, 216 STATE_ADD_TO_ENTRY,
213 STATE_ADD_TO_ENTRY_COMPLETE, 217 STATE_ADD_TO_ENTRY_COMPLETE,
218 STATE_DONE_HEADERS_ADD_TO_ENTRY_COMPLETE,
214 STATE_CACHE_READ_RESPONSE, 219 STATE_CACHE_READ_RESPONSE,
215 STATE_CACHE_READ_RESPONSE_COMPLETE, 220 STATE_CACHE_READ_RESPONSE_COMPLETE,
216 STATE_TOGGLE_UNUSED_SINCE_PREFETCH, 221 STATE_TOGGLE_UNUSED_SINCE_PREFETCH,
217 STATE_TOGGLE_UNUSED_SINCE_PREFETCH_COMPLETE, 222 STATE_TOGGLE_UNUSED_SINCE_PREFETCH_COMPLETE,
218 STATE_CACHE_DISPATCH_VALIDATION, 223 STATE_CACHE_DISPATCH_VALIDATION,
219 STATE_CACHE_QUERY_DATA, 224 STATE_CACHE_QUERY_DATA,
220 STATE_CACHE_QUERY_DATA_COMPLETE, 225 STATE_CACHE_QUERY_DATA_COMPLETE,
221 STATE_START_PARTIAL_CACHE_VALIDATION, 226 STATE_START_PARTIAL_CACHE_VALIDATION,
222 STATE_COMPLETE_PARTIAL_CACHE_VALIDATION, 227 STATE_COMPLETE_PARTIAL_CACHE_VALIDATION,
223 STATE_SEND_REQUEST, 228 STATE_SEND_REQUEST,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 int DoGetBackendComplete(int result); 280 int DoGetBackendComplete(int result);
276 int DoInitEntry(); 281 int DoInitEntry();
277 int DoOpenEntry(); 282 int DoOpenEntry();
278 int DoOpenEntryComplete(int result); 283 int DoOpenEntryComplete(int result);
279 int DoDoomEntry(); 284 int DoDoomEntry();
280 int DoDoomEntryComplete(int result); 285 int DoDoomEntryComplete(int result);
281 int DoCreateEntry(); 286 int DoCreateEntry();
282 int DoCreateEntryComplete(int result); 287 int DoCreateEntryComplete(int result);
283 int DoAddToEntry(); 288 int DoAddToEntry();
284 int DoAddToEntryComplete(int result); 289 int DoAddToEntryComplete(int result);
290 int DoDoneHeadersAddToEntryComplete(int result);
285 int DoCacheReadResponse(); 291 int DoCacheReadResponse();
286 int DoCacheReadResponseComplete(int result); 292 int DoCacheReadResponseComplete(int result);
287 int DoCacheToggleUnusedSincePrefetch(); 293 int DoCacheToggleUnusedSincePrefetch();
288 int DoCacheToggleUnusedSincePrefetchComplete(int result); 294 int DoCacheToggleUnusedSincePrefetchComplete(int result);
289 int DoCacheDispatchValidation(); 295 int DoCacheDispatchValidation();
290 int DoCacheQueryData(); 296 int DoCacheQueryData();
291 int DoCacheQueryDataComplete(int result); 297 int DoCacheQueryDataComplete(int result);
292 int DoStartPartialCacheValidation(); 298 int DoStartPartialCacheValidation();
293 int DoCompletePartialCacheValidation(int result); 299 int DoCompletePartialCacheValidation(int result);
294 int DoSendRequest(); 300 int DoSendRequest();
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 std::string cache_key_; 501 std::string cache_key_;
496 Mode mode_; 502 Mode mode_;
497 bool reading_; // We are already reading. Never reverts to false once set. 503 bool reading_; // We are already reading. Never reverts to false once set.
498 bool invalid_range_; // We may bypass the cache for this request. 504 bool invalid_range_; // We may bypass the cache for this request.
499 bool truncated_; // We don't have all the response data. 505 bool truncated_; // We don't have all the response data.
500 bool is_sparse_; // The data is stored in sparse byte ranges. 506 bool is_sparse_; // The data is stored in sparse byte ranges.
501 bool range_requested_; // The user requested a byte range. 507 bool range_requested_; // The user requested a byte range.
502 bool handling_206_; // We must deal with this 206 response. 508 bool handling_206_; // We must deal with this 206 response.
503 bool cache_pending_; // We are waiting for the HttpCache. 509 bool cache_pending_; // We are waiting for the HttpCache.
504 bool done_reading_; // All available data was read. 510 bool done_reading_; // All available data was read.
511
512 // Headers have been received from the network and it's not a match with the
513 // existing entry.
514 bool done_headers_create_new_entry_;
515
505 bool vary_mismatch_; // The request doesn't match the stored vary data. 516 bool vary_mismatch_; // The request doesn't match the stored vary data.
506 bool couldnt_conditionalize_request_; 517 bool couldnt_conditionalize_request_;
507 bool bypass_lock_for_test_; // A test is exercising the cache lock. 518 bool bypass_lock_for_test_; // A test is exercising the cache lock.
508 bool bypass_lock_after_headers_for_test_; // A test is exercising the cache 519 bool bypass_lock_after_headers_for_test_; // A test is exercising the cache
509 // lock. 520 // lock.
510 bool fail_conditionalization_for_test_; // Fail ConditionalizeRequest. 521 bool fail_conditionalization_for_test_; // Fail ConditionalizeRequest.
511 scoped_refptr<IOBuffer> read_buf_; 522 scoped_refptr<IOBuffer> read_buf_;
512 int io_buf_len_; 523 int io_buf_len_;
513 int read_offset_; 524 int read_offset_;
514 int effective_load_flags_; 525 int effective_load_flags_;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 bool in_do_loop_; 566 bool in_do_loop_;
556 567
557 base::WeakPtrFactory<Transaction> weak_factory_; 568 base::WeakPtrFactory<Transaction> weak_factory_;
558 569
559 DISALLOW_COPY_AND_ASSIGN(Transaction); 570 DISALLOW_COPY_AND_ASSIGN(Transaction);
560 }; 571 };
561 572
562 } // namespace net 573 } // namespace net
563 574
564 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 575 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_
OLDNEW
« no previous file with comments | « net/http/http_cache.cc ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698