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

Unified Diff: chrome/browser/renderer_host/buffered_resource_handler.cc

Issue 20524: Clean up WebKit resources after starting a download (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/buffered_resource_handler.cc
===================================================================
--- chrome/browser/renderer_host/buffered_resource_handler.cc (revision 10284)
+++ chrome/browser/renderer_host/buffered_resource_handler.cc (working copy)
@@ -264,11 +264,15 @@
CHECK((buf_len >= bytes_read_) && (bytes_read_ >= 0));
memcpy(buf->data(), read_buffer_->data(), bytes_read_);
}
- // Update the renderer with the response headers which will cause it to
- // cancel the request.
- // TODO(paulg): Send the renderer a response that indicates that the request
- // will be handled by an external source (the browser).
+
+ // Send the renderer a response that indicates that the request will be
+ // handled by an external source (the browser's DownloadManager).
real_handler_->OnResponseStarted(info->request_id, response_);
+ URLRequestStatus status(URLRequestStatus::HANDLED_EXTERNALLY, 0);
+ real_handler_->OnResponseCompleted(info->request_id, status);
+
+ // Ditch the old async handler that talks to the renderer for the new
+ // download handler that talks to the DownloadManager.
real_handler_ = download_handler;
}
return real_handler_->OnResponseStarted(request_id, response_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698