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

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: Feedback addressed Created 3 years, 6 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 int ResumeNetworkStart() override; 168 int ResumeNetworkStart() override;
169 void GetConnectionAttempts(ConnectionAttempts* out) const override; 169 void GetConnectionAttempts(ConnectionAttempts* out) const override;
170 170
171 // Invoked when parallel validation cannot proceed due to response failure 171 // Invoked when parallel validation cannot proceed due to response failure
172 // and this transaction needs to be restarted. 172 // and this transaction needs to be restarted.
173 void SetValidatingCannotProceed(); 173 void SetValidatingCannotProceed();
174 174
175 // Returns the estimate of dynamically allocated memory in bytes. 175 // Returns the estimate of dynamically allocated memory in bytes.
176 size_t EstimateMemoryUsage() const; 176 size_t EstimateMemoryUsage() const;
177 177
178 // Sets fail state such that a future Read fails with |error_code|.
179 void SetSharedWritingFailState(int error_code);
180
181 RequestPriority priority() const { return priority_; }
182 PartialData* partial() { return partial_.get(); }
183
178 private: 184 private:
179 static const size_t kNumValidationHeaders = 2; 185 static const size_t kNumValidationHeaders = 2;
180 // Helper struct to pair a header name with its value, for 186 // Helper struct to pair a header name with its value, for
181 // headers used to validate cache entries. 187 // headers used to validate cache entries.
182 struct ValidationHeaders { 188 struct ValidationHeaders {
183 ValidationHeaders() : initialized(false) {} 189 ValidationHeaders() : initialized(false) {}
184 190
185 std::string values[kNumValidationHeaders]; 191 std::string values[kNumValidationHeaders];
186 bool initialized; 192 bool initialized;
187 }; 193 };
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 RestartInfo restart_info_; 555 RestartInfo restart_info_;
550 556
551 base::WeakPtrFactory<Transaction> weak_factory_; 557 base::WeakPtrFactory<Transaction> weak_factory_;
552 558
553 DISALLOW_COPY_AND_ASSIGN(Transaction); 559 DISALLOW_COPY_AND_ASSIGN(Transaction);
554 }; 560 };
555 561
556 } // namespace net 562 } // namespace net
557 563
558 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 564 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698