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

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: Fix test class memory leak 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Returns the estimate of dynamically allocated memory in bytes. 179 // Returns the estimate of dynamically allocated memory in bytes.
180 size_t EstimateMemoryUsage() const; 180 size_t EstimateMemoryUsage() const;
181 181
182 // Sets fail state such that a future Read fails with |error_code|.
183 void SetSharedWritingFailState(int error_code);
184
185 RequestPriority priority() const { return priority_; }
186 PartialData* partial() { return partial_.get(); }
187
182 private: 188 private:
183 static const size_t kNumValidationHeaders = 2; 189 static const size_t kNumValidationHeaders = 2;
184 // Helper struct to pair a header name with its value, for 190 // Helper struct to pair a header name with its value, for
185 // headers used to validate cache entries. 191 // headers used to validate cache entries.
186 struct ValidationHeaders { 192 struct ValidationHeaders {
187 ValidationHeaders() : initialized(false) {} 193 ValidationHeaders() : initialized(false) {}
188 194
189 std::string values[kNumValidationHeaders]; 195 std::string values[kNumValidationHeaders];
190 void Reset() { 196 void Reset() {
191 initialized = false; 197 initialized = false;
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 bool in_do_loop_; 561 bool in_do_loop_;
556 562
557 base::WeakPtrFactory<Transaction> weak_factory_; 563 base::WeakPtrFactory<Transaction> weak_factory_;
558 564
559 DISALLOW_COPY_AND_ASSIGN(Transaction); 565 DISALLOW_COPY_AND_ASSIGN(Transaction);
560 }; 566 };
561 567
562 } // namespace net 568 } // namespace net
563 569
564 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 570 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698