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

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

Issue 7660007: Factor out dependncy on download throttling from core download code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/buffered_resource_handler.cc
===================================================================
--- content/browser/renderer_host/buffered_resource_handler.cc (revision 96872)
+++ content/browser/renderer_host/buffered_resource_handler.cc (working copy)
@@ -9,9 +9,9 @@
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/string_util.h"
-#include "chrome/browser/renderer_host/download_throttling_resource_handler.h"
#include "content/browser/browser_thread.h"
#include "content/browser/content_browser_client.h"
+#include "content/browser/download/download_resource_handler.h"
#include "content/browser/renderer_host/resource_dispatcher_host.h"
#include "content/browser/renderer_host/resource_dispatcher_host_delegate.h"
#include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
@@ -308,15 +308,24 @@
info->set_is_download(true);
- DownloadThrottlingResourceHandler* download_handler =
- new DownloadThrottlingResourceHandler(host_,
- request_,
- request_->url(),
- info->child_id(),
- info->route_id(),
- request_id,
- in_complete);
- UseAlternateResourceHandler(request_id, download_handler);
+ scoped_refptr<ResourceHandler> handler(
Paweł Hajdan Jr. 2011/08/16 17:14:08 This is a bit suspicious to me: previously this wa
jam 2011/08/16 18:18:20 this is fine as well, we use this pattern in other
+ new DownloadResourceHandler(host_,
+ info->child_id(),
+ info->route_id(),
+ info->request_id(),
+ request_->url(),
+ host_->download_file_manager(),
+ request_,
+ false,
+ DownloadSaveInfo()));
+
+ if (host_->delegate()) {
+ handler = host_->delegate()->DownloadStarting(
+ handler, *info->context(), request_, info->child_id(),
+ info->route_id(), info->request_id(), false, in_complete);
+ }
+
+ UseAlternateResourceHandler(request_id, handler);
}
return real_handler_->OnResponseStarted(request_id, response_);
}

Powered by Google App Engine
This is Rietveld 408576698