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

Side by Side Diff: net/http/http_cache.cc

Issue 10382089: Http cache: Don't attempt to doom the same entry multiple times (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/http/http_cache_transaction.h » ('j') | net/http/http_cache_transaction.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "net/http/http_cache.h" 5 #include "net/http/http_cache.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 10
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 if (entry->writer) { 853 if (entry->writer) {
854 DCHECK(trans == entry->writer); 854 DCHECK(trans == entry->writer);
855 855
856 // Assume there was a failure. 856 // Assume there was a failure.
857 bool success = false; 857 bool success = false;
858 if (cancel) { 858 if (cancel) {
859 DCHECK(entry->disk_entry); 859 DCHECK(entry->disk_entry);
860 // This is a successful operation in the sense that we want to keep the 860 // This is a successful operation in the sense that we want to keep the
861 // entry. 861 // entry.
862 success = trans->AddTruncatedFlag(); 862 success = trans->AddTruncatedFlag();
863 // The previous operation may have deleted the entry.
864 if (!trans->entry())
865 return;
863 } 866 }
864 DoneWritingToEntry(entry, success); 867 DoneWritingToEntry(entry, success);
865 } else { 868 } else {
866 DoneReadingFromEntry(entry, trans); 869 DoneReadingFromEntry(entry, trans);
867 } 870 }
868 } 871 }
869 872
870 void HttpCache::DoneWritingToEntry(ActiveEntry* entry, bool success) { 873 void HttpCache::DoneWritingToEntry(ActiveEntry* entry, bool success) {
871 DCHECK(entry->readers.empty()); 874 DCHECK(entry->readers.empty());
872 875
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 building_backend_ = false; 1176 building_backend_ = false;
1174 DeletePendingOp(pending_op); 1177 DeletePendingOp(pending_op);
1175 } 1178 }
1176 1179
1177 // The cache may be gone when we return from the callback. 1180 // The cache may be gone when we return from the callback.
1178 if (!item->DoCallback(result, backend)) 1181 if (!item->DoCallback(result, backend))
1179 item->NotifyTransaction(result, NULL); 1182 item->NotifyTransaction(result, NULL);
1180 } 1183 }
1181 1184
1182 } // namespace net 1185 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_cache_transaction.h » ('j') | net/http/http_cache_transaction.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698