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

Unified Diff: net/http/http_cache_transaction.cc

Issue 2970133002: DoomPartialEntry should not attempt to doom an already doomed entry. (Closed)
Patch Set: Test and test framework changes added. 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
Index: net/http/http_cache_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 6be3d8711dc70b41ae8a3c269ff74d60e7cd61d5..e159cb9101d1b13a17fa43a295c56196ccc87fef 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -1561,7 +1561,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);
}
@@ -2846,8 +2847,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;

Powered by Google App Engine
This is Rietveld 408576698