| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1248 // We do this before calling EntryAvailable to force any further calls to | 1248 // We do this before calling EntryAvailable to force any further calls to |
| 1249 // AddTransactionToEntry to add their transaction to the pending queue, which | 1249 // AddTransactionToEntry to add their transaction to the pending queue, which |
| 1250 // ensures FIFO ordering. | 1250 // ensures FIFO ordering. |
| 1251 if (!entry->pending_queue.empty()) | 1251 if (!entry->pending_queue.empty()) |
| 1252 ProcessPendingQueue(entry); | 1252 ProcessPendingQueue(entry); |
| 1253 | 1253 |
| 1254 return trans->EntryAvailable(entry); | 1254 return trans->EntryAvailable(entry); |
| 1255 } | 1255 } |
| 1256 | 1256 |
| 1257 void HttpCache::DoneWithEntry(ActiveEntry* entry, Transaction* trans) { | 1257 void HttpCache::DoneWithEntry(ActiveEntry* entry, Transaction* trans) { |
| 1258 // If we already posted a task to move on to the next transaction, there is | 1258 // If we already posted a task to move on to the next transaction and this was |
| 1259 // nothing to cancel. | 1259 // the writer, there is nothing to cancel. |
| 1260 if (entry->will_process_pending_queue) | 1260 if (entry->will_process_pending_queue && entry->readers.empty()) |
| 1261 return; | 1261 return; |
| 1262 | 1262 |
| 1263 if (entry->writer) { | 1263 if (entry->writer) { |
| 1264 // TODO(rvargas): convert this to a DCHECK. | 1264 // TODO(rvargas): convert this to a DCHECK. |
| 1265 CHECK(trans == entry->writer); | 1265 CHECK(trans == entry->writer); |
| 1266 // Assume that this is not a successful write. | 1266 // Assume that this is not a successful write. |
| 1267 DoneWritingToEntry(entry, false); | 1267 DoneWritingToEntry(entry, false); |
| 1268 } else { | 1268 } else { |
| 1269 DoneReadingFromEntry(entry, trans); | 1269 DoneReadingFromEntry(entry, trans); |
| 1270 } | 1270 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 | 1370 |
| 1371 entry->pending_queue.erase(entry->pending_queue.begin()); | 1371 entry->pending_queue.erase(entry->pending_queue.begin()); |
| 1372 | 1372 |
| 1373 AddTransactionToEntry(entry, next); | 1373 AddTransactionToEntry(entry, next); |
| 1374 } | 1374 } |
| 1375 | 1375 |
| 1376 //----------------------------------------------------------------------------- | 1376 //----------------------------------------------------------------------------- |
| 1377 | 1377 |
| 1378 } // namespace net | 1378 } // namespace net |
| 1379 | 1379 |
| OLD | NEW |