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

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

Issue 2767033003: [HttpCache::Transaction] Ensure each state only sets the next state once (Closed)
Patch Set: AutoReset Created 3 years, 9 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 | « no previous file | 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 void UpdateCacheEntryStatus( 427 void UpdateCacheEntryStatus(
428 HttpResponseInfo::CacheEntryStatus new_cache_entry_status); 428 HttpResponseInfo::CacheEntryStatus new_cache_entry_status);
429 429
430 // Sets the response.cache_entry_status to the current cache_entry_status_. 430 // Sets the response.cache_entry_status to the current cache_entry_status_.
431 void SyncCacheEntryStatusToResponse(); 431 void SyncCacheEntryStatusToResponse();
432 void RecordHistograms(); 432 void RecordHistograms();
433 433
434 // Called to signal completion of asynchronous IO. 434 // Called to signal completion of asynchronous IO.
435 void OnIOComplete(int result); 435 void OnIOComplete(int result);
436 436
437 // When in a DoLoop, use this to set the next state as it verifies that the
438 // state isn't set twice.
439 void TransitionToState(State state);
440
437 State next_state_; 441 State next_state_;
438 const HttpRequestInfo* request_; 442 const HttpRequestInfo* request_;
439 RequestPriority priority_; 443 RequestPriority priority_;
440 NetLogWithSource net_log_; 444 NetLogWithSource net_log_;
441 std::unique_ptr<HttpRequestInfo> custom_request_; 445 std::unique_ptr<HttpRequestInfo> custom_request_;
442 HttpRequestHeaders request_headers_copy_; 446 HttpRequestHeaders request_headers_copy_;
443 // If extra_headers specified a "if-modified-since" or "if-none-match", 447 // If extra_headers specified a "if-modified-since" or "if-none-match",
444 // |external_validation_| contains the value of those headers. 448 // |external_validation_| contains the value of those headers.
445 ValidationHeaders external_validation_; 449 ValidationHeaders external_validation_;
446 base::WeakPtr<HttpCache> cache_; 450 base::WeakPtr<HttpCache> cache_;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 // The helper object to use to create WebSocketHandshakeStreamBase 505 // The helper object to use to create WebSocketHandshakeStreamBase
502 // objects. Only relevant when establishing a WebSocket connection. 506 // objects. Only relevant when establishing a WebSocket connection.
503 // This is passed to the underlying network transaction. It is stored here in 507 // This is passed to the underlying network transaction. It is stored here in
504 // case the transaction does not exist yet. 508 // case the transaction does not exist yet.
505 WebSocketHandshakeStreamBase::CreateHelper* 509 WebSocketHandshakeStreamBase::CreateHelper*
506 websocket_handshake_stream_base_create_helper_; 510 websocket_handshake_stream_base_create_helper_;
507 511
508 BeforeNetworkStartCallback before_network_start_callback_; 512 BeforeNetworkStartCallback before_network_start_callback_;
509 BeforeHeadersSentCallback before_headers_sent_callback_; 513 BeforeHeadersSentCallback before_headers_sent_callback_;
510 514
515 // True if the Transaction is currently processing the DoLoop.
516 bool in_do_loop_;
517
511 base::WeakPtrFactory<Transaction> weak_factory_; 518 base::WeakPtrFactory<Transaction> weak_factory_;
512 519
513 DISALLOW_COPY_AND_ASSIGN(Transaction); 520 DISALLOW_COPY_AND_ASSIGN(Transaction);
514 }; 521 };
515 522
516 } // namespace net 523 } // namespace net
517 524
518 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 525 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_cache_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698