Commit 1285d6a4 authored by Shivani Sharma's avatar Shivani Sharma Committed by Commit Bot

Remove mode assumptions from HttpCache::DoneWithResponseHeaders

Since multiple transactions can now be added to Writers, those transactions will have a WRITE
bit set. Thus remove the DCHECKS that assume otherwise in HttpCache::DoneWithResponseHeaders.

Bug: 750725
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I791177522956ca23d6702254bbf7ee0b25c83bdf
Reviewed-on: https://chromium-review.googlesource.com/760540Reviewed-by: default avatarRandy Smith <rdsmith@chromium.org>
Commit-Queue: Shivani Sharma <shivanisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515459}
parent 4be510bf
......@@ -843,28 +843,12 @@ int HttpCache::DoneWithResponseHeaders(ActiveEntry* entry,
// through done_headers_queue for performance benefit. (Also, in case of
// writer transaction, the consumer sometimes depend on synchronous behaviour
// e.g. while computing raw headers size. (crbug.com/711766))
if (transaction->mode() & Transaction::WRITE) {
// Partial requests may have write mode even when there is a writer present
// since they may be reader for a particular range and writer for another
// range.
if (!is_partial) {
// TODO(crbug.com/750725)
DCHECK(!entry->writers || entry->writers->CanAddWriters());
DCHECK(entry->done_headers_queue.empty());
}
if (!entry->writers) {
AddTransactionToWriters(entry, transaction);
ProcessQueuedTransactions(entry);
return OK;
}
if ((transaction->mode() & Transaction::WRITE) && !entry->writers) {
AddTransactionToWriters(entry, transaction);
ProcessQueuedTransactions(entry);
return OK;
}
// If this is not the first transaction in done_headers_queue, it should be a
// read-mode transaction except if it is a partial request.
DCHECK(is_partial || (entry->done_headers_queue.empty() ||
!(transaction->mode() & Transaction::WRITE)));
entry->done_headers_queue.push_back(transaction);
ProcessQueuedTransactions(entry);
return ERR_IO_PENDING;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment