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

Unified Diff: net/http/http_cache_transaction.cc

Issue 2970133002: DoomPartialEntry should not attempt to doom an already doomed entry. (Closed)
Patch Set: Feedback 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 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_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 10b6d9136c7b83246b80e84c002bda02a6553519..68640aaba62fa39ec026ba165b4c61e206effaf0 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -1609,7 +1609,8 @@ int HttpCache::Transaction::DoSuccessfulSendRequest() {
// Invalidate any cached GET with a successful PUT or DELETE.
if (mode_ == WRITE && (method_ == "PUT" || method_ == "DELETE")) {
- if (NonErrorResponse(new_response->headers->response_code())) {
+ if (NonErrorResponse(new_response->headers->response_code()) &&
+ (entry_ && !entry_->doomed)) {
int ret = cache_->DoomEntry(cache_key_, NULL);
DCHECK_EQ(OK, ret);
}
@@ -2902,8 +2903,10 @@ void HttpCache::Transaction::OnCacheLockTimeout(base::TimeTicks start_time) {
void HttpCache::Transaction::DoomPartialEntry(bool delete_object) {
DVLOG(2) << "DoomPartialEntry";
- int rv = cache_->DoomEntry(cache_key_, NULL);
- DCHECK_EQ(OK, rv);
+ if (entry_ && !entry_->doomed) {
+ int rv = cache_->DoomEntry(cache_key_, NULL);
+ DCHECK_EQ(OK, rv);
+ }
cache_->DoneWithEntry(entry_, this, false /* process_cancel */,
partial_ != nullptr);
entry_ = NULL;
« no previous file with comments | « net/http/http_cache.h ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698