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

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

Issue 2886483002: Adds a new class HttpCache::Writers for multiple cache transactions reading from the network. (Closed)
Patch Set: jkarlin feebdack addressed 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
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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 179 // Invoked to remove the association between a transaction waiting to be
180 // added to an entry and the entry. 180 // added to an entry and the entry.
181 void ResetCachePendingState() { cache_pending_ = false; } 181 void ResetCachePendingState() { cache_pending_ = false; }
182 182
183 // Returns the estimate of dynamically allocated memory in bytes. 183 // Returns the estimate of dynamically allocated memory in bytes.
184 size_t EstimateMemoryUsage() const; 184 size_t EstimateMemoryUsage() const;
185 185
186 // Sets fail state such that a future Read fails with |error_code|.
187 void SetSharedWritingFailState(int error_code);
188
189 RequestPriority priority() const { return priority_; }
190 PartialData* partial() { return partial_.get(); }
191
186 private: 192 private:
187 static const size_t kNumValidationHeaders = 2; 193 static const size_t kNumValidationHeaders = 2;
188 // Helper struct to pair a header name with its value, for 194 // Helper struct to pair a header name with its value, for
189 // headers used to validate cache entries. 195 // headers used to validate cache entries.
190 struct ValidationHeaders { 196 struct ValidationHeaders {
191 ValidationHeaders() : initialized(false) {} 197 ValidationHeaders() : initialized(false) {}
192 198
193 std::string values[kNumValidationHeaders]; 199 std::string values[kNumValidationHeaders];
194 void Reset() { 200 void Reset() {
195 initialized = false; 201 initialized = false;
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 bool in_do_loop_; 572 bool in_do_loop_;
567 573
568 base::WeakPtrFactory<Transaction> weak_factory_; 574 base::WeakPtrFactory<Transaction> weak_factory_;
569 575
570 DISALLOW_COPY_AND_ASSIGN(Transaction); 576 DISALLOW_COPY_AND_ASSIGN(Transaction);
571 }; 577 };
572 578
573 } // namespace net 579 } // namespace net
574 580
575 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 581 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698