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

Unified Diff: content/browser/renderer_host/redirect_to_file_resource_handler.cc

Issue 10578055: Rewrite guts of ResourceLoader and BufferedResourceHandler to suck less. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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: content/browser/renderer_host/redirect_to_file_resource_handler.cc
===================================================================
--- content/browser/renderer_host/redirect_to_file_resource_handler.cc (revision 144275)
+++ content/browser/renderer_host/redirect_to_file_resource_handler.cc (working copy)
@@ -106,24 +106,14 @@
}
bool RedirectToFileResourceHandler::OnReadCompleted(int request_id,
- int* bytes_read,
+ int bytes_read,
bool* defer) {
- if (!buf_write_pending_) {
- // Ignore spurious OnReadCompleted! Deferring from OnReadCompleted tells
- // the ResourceDispatcherHost that we did not consume the data.
- // ResumeDeferredRequest then repeats the last OnReadCompleted call. We
- // pause the request so that we can copy our buffer to disk, so we need to
- // consume the data now. The ResourceDispatcherHost pause mechanism does
- // not fit our use case very well. TODO(darin): Fix the
- // ResourceDispatcherHost to avoid this hack!
- return true;
- }
-
+ DCHECK(buf_write_pending_);
buf_write_pending_ = false;
// We use the buffer's offset field to record the end of the buffer.
- int new_offset = buf_->offset() + *bytes_read;
+ int new_offset = buf_->offset() + bytes_read;
DCHECK(new_offset <= buf_->capacity());
buf_->set_offset(new_offset);

Powered by Google App Engine
This is Rietveld 408576698