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

Unified Diff: net/http/mock_http_cache.cc

Issue 1230113012: [net] Better StopCaching() handling for HttpCache::Transaction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing MockTransaction initializers Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: net/http/mock_http_cache.cc
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc
index d939a3d8f9692f9f6c8eeddeda0e97dd1ccc38ca..5b946cac5337babb6774e449e0be3e0721878560 100644
--- a/net/http/mock_http_cache.cc
+++ b/net/http/mock_http_cache.cc
@@ -495,6 +495,11 @@ void MockDiskCache::GetStats(base::StringPairs* stats) {
void MockDiskCache::OnExternalCacheHit(const std::string& key) {
}
+void MockDiskCache::ResetCounts() {
+ open_count_ = 0;
+ create_count_ = 0;
+}
+
void MockDiskCache::ReleaseAll() {
EntryMap::iterator it = entries_.begin();
for (; it != entries_.end(); ++it)
@@ -551,6 +556,11 @@ void MockHttpCache::FailConditionalizations() {
http_cache_.FailConditionalizationForTest();
}
+void MockHttpCache::ResetCounts() {
+ disk_cache()->ResetCounts();
+ network_layer()->ResetTransactionCount();
+}
+
bool MockHttpCache::ReadResponseInfo(disk_cache::Entry* disk_entry,
HttpResponseInfo* response_info,
bool* response_truncated) {

Powered by Google App Engine
This is Rietveld 408576698