Index: content/browser/download/download_resource_handler.cc |
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc |
index e52984a1c478b7c3063c95a0768208a4bc59dca2..c7ba502b98387a62fd9a9a69b3853101763d5c00 100644 |
--- a/content/browser/download/download_resource_handler.cc |
+++ b/content/browser/download/download_resource_handler.cc |
@@ -171,9 +171,16 @@ void DownloadResourceHandler::OnWillStart( |
// Create a new buffer, which will be handed to the download thread for file |
// writing and deletion. |
-bool DownloadResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
- int* buf_size) { |
- return core_.OnWillRead(buf, buf_size); |
+void DownloadResourceHandler::OnWillRead( |
+ scoped_refptr<net::IOBuffer>* buf, |
+ int* buf_size, |
+ std::unique_ptr<ResourceController> controller) { |
+ if (!core_.OnWillRead(buf, buf_size)) { |
+ controller->Cancel(); |
+ return; |
+ } |
+ |
+ controller->Resume(); |
} |
// Pass the buffer to the download file writer. |