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

Unified Diff: net/http/http_cache.cc

Issue 1008723006: Remove HTTP cache Record/Playback support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_cache.h ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache.cc
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 5260410356d1bbf835e64a01ae8dce83042aa01f..dc6f516987efd8aac27cb955c1f7dc0d1053997a 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -721,39 +721,16 @@ std::string HttpCache::GenerateCacheKey(const HttpRequestInfo* request) {
// Strip out the reference, username, and password sections of the URL.
std::string url = HttpUtil::SpecForRequest(request->url);
- DCHECK(mode_ != DISABLE);
- if (mode_ == NORMAL) {
- // No valid URL can begin with numerals, so we should not have to worry
- // about collisions with normal URLs.
- if (request->upload_data_stream &&
- request->upload_data_stream->identifier()) {
- url.insert(0, base::StringPrintf(
- "%" PRId64 "/", request->upload_data_stream->identifier()));
- }
- return url;
+ DCHECK_NE(DISABLE, mode_);
+ // No valid URL can begin with numerals, so we should not have to worry
+ // about collisions with normal URLs.
+ if (request->upload_data_stream &&
+ request->upload_data_stream->identifier()) {
+ url.insert(0,
+ base::StringPrintf("%" PRId64 "/",
+ request->upload_data_stream->identifier()));
}
-
- // In playback and record mode, we cache everything.
-
- // Lazily initialize.
- if (playback_cache_map_ == NULL)
- playback_cache_map_.reset(new PlaybackCacheMap());
-
- // Each time we request an item from the cache, we tag it with a
- // generation number. During playback, multiple fetches for the same
- // item will use the same generation number and pull the proper
- // instance of an URL from the cache.
- int generation = 0;
- DCHECK(playback_cache_map_ != NULL);
- if (playback_cache_map_->find(url) != playback_cache_map_->end())
- generation = (*playback_cache_map_)[url];
- (*playback_cache_map_)[url] = generation + 1;
-
- // The key into the cache is GENERATION # + METHOD + URL.
- std::string result = base::IntToString(generation);
- result.append(request->method);
- result.append(url);
- return result;
+ return url;
}
void HttpCache::DoomActiveEntry(const std::string& key) {
« no previous file with comments | « net/http/http_cache.h ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698