| 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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 // We do this before calling EntryAvailable to force any further calls to | 1238 // We do this before calling EntryAvailable to force any further calls to |
| 1239 // AddTransactionToEntry to add their transaction to the pending queue, which | 1239 // AddTransactionToEntry to add their transaction to the pending queue, which |
| 1240 // ensures FIFO ordering. | 1240 // ensures FIFO ordering. |
| 1241 if (!entry->pending_queue.empty()) | 1241 if (!entry->pending_queue.empty()) |
| 1242 ProcessPendingQueue(entry); | 1242 ProcessPendingQueue(entry); |
| 1243 | 1243 |
| 1244 return trans->EntryAvailable(entry); | 1244 return trans->EntryAvailable(entry); |
| 1245 } | 1245 } |
| 1246 | 1246 |
| 1247 void HttpCache::DoneWithEntry(ActiveEntry* entry, Transaction* trans) { | 1247 void HttpCache::DoneWithEntry(ActiveEntry* entry, Transaction* trans) { |
| 1248 // If we already posted a task to move on to the next transaction, there is | 1248 // If we already posted a task to move on to the next transaction and this was |
| 1249 // nothing to cancel. | 1249 // the writer, there is nothing to cancel. |
| 1250 if (entry->will_process_pending_queue) | 1250 if (entry->will_process_pending_queue && entry->readers.empty()) |
| 1251 return; | 1251 return; |
| 1252 | 1252 |
| 1253 if (entry->writer) { | 1253 if (entry->writer) { |
| 1254 // TODO(rvargas): convert this to a DCHECK. | 1254 // TODO(rvargas): convert this to a DCHECK. |
| 1255 CHECK(trans == entry->writer); | 1255 CHECK(trans == entry->writer); |
| 1256 // Assume that this is not a successful write. | 1256 // Assume that this is not a successful write. |
| 1257 DoneWritingToEntry(entry, false); | 1257 DoneWritingToEntry(entry, false); |
| 1258 } else { | 1258 } else { |
| 1259 DoneReadingFromEntry(entry, trans); | 1259 DoneReadingFromEntry(entry, trans); |
| 1260 } | 1260 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 | 1360 |
| 1361 entry->pending_queue.erase(entry->pending_queue.begin()); | 1361 entry->pending_queue.erase(entry->pending_queue.begin()); |
| 1362 | 1362 |
| 1363 AddTransactionToEntry(entry, next); | 1363 AddTransactionToEntry(entry, next); |
| 1364 } | 1364 } |
| 1365 | 1365 |
| 1366 //----------------------------------------------------------------------------- | 1366 //----------------------------------------------------------------------------- |
| 1367 | 1367 |
| 1368 } // namespace net | 1368 } // namespace net |
| 1369 | 1369 |
| OLD | NEW |