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

Unified Diff: content/browser/loader/mojo_async_resource_handler.cc

Issue 2484933002: MojoAsyncResourceHandler: Ignore Resume/OnWritable calls after error. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | content/browser/loader/mojo_async_resource_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/mojo_async_resource_handler.cc
diff --git a/content/browser/loader/mojo_async_resource_handler.cc b/content/browser/loader/mojo_async_resource_handler.cc
index b66c389d3ff84b0a3af098cafe9dfbf060f2c835..cf4189b4d6df284899bc2716bfcff2eb50550a35 100644
--- a/content/browser/loader/mojo_async_resource_handler.cc
+++ b/content/browser/loader/mojo_async_resource_handler.cc
@@ -347,28 +347,28 @@ bool MojoAsyncResourceHandler::AllocateWriterIOBuffer(
void MojoAsyncResourceHandler::Resume() {
if (!did_defer_)
return;
- bool defer = false;
+ did_defer_ = false;
+
if (is_using_io_buffer_not_from_writer_) {
// |buffer_| is set to a net::IOBufferWithSize. Write the buffer contents
// to the data pipe.
DCHECK_GT(buffer_bytes_read_, 0u);
- if (!CopyReadDataToDataPipe(&defer)) {
+ if (!CopyReadDataToDataPipe(&did_defer_)) {
controller()->CancelWithError(net::ERR_FAILED);
return;
}
} else {
// Allocate a buffer for the next OnWillRead call here.
- if (!AllocateWriterIOBuffer(&buffer_, &defer)) {
+ if (!AllocateWriterIOBuffer(&buffer_, &did_defer_)) {
controller()->CancelWithError(net::ERR_FAILED);
return;
}
}
- if (defer) {
+ if (did_defer_) {
// Continue waiting.
return;
}
- did_defer_ = false;
request()->LogUnblocked();
controller()->Resume();
}
« no previous file with comments | « no previous file | content/browser/loader/mojo_async_resource_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698