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

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

Issue 1403001: Modifying the "dangerous download" algorithm. (Closed)
Patch Set: Adding .sys and .drv as Dangerous extensions Created 10 years 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: chrome/browser/renderer_host/download_resource_handler.cc
diff --git a/chrome/browser/renderer_host/download_resource_handler.cc b/chrome/browser/renderer_host/download_resource_handler.cc
index 5de9750f1064c1da18732485ce044f7b9596bff1..00cbcd469ddb7355f9b1138a28118ddccc325a80 100644
--- a/chrome/browser/renderer_host/download_resource_handler.cc
+++ b/chrome/browser/renderer_host/download_resource_handler.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/history/download_create_info.h"
#include "chrome/browser/renderer_host/global_request_id.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
+#include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h"
#include "chrome/common/resource_response.h"
#include "net/base/io_buffer.h"
#include "net/http/http_response_headers.h"
@@ -69,6 +70,9 @@ bool DownloadResourceHandler::OnResponseStarted(int request_id,
set_content_disposition(content_disposition);
set_content_length(response->response_head.content_length);
+ const ResourceDispatcherHostRequestInfo* request_info =
+ ResourceDispatcherHost::InfoForRequest(request_);
+
download_id_ = download_file_manager_->GetNextId();
// |download_file_manager_| consumes (deletes):
DownloadCreateInfo* info = new DownloadCreateInfo;
@@ -79,6 +83,7 @@ bool DownloadResourceHandler::OnResponseStarted(int request_id,
info->total_bytes = content_length_;
info->state = DownloadItem::IN_PROGRESS;
info->download_id = download_id_;
+ info->has_user_gesture = request_info->has_user_gesture();
info->child_id = global_id_.child_id;
info->render_view_id = render_view_id_;
info->request_id = global_id_.request_id;
« no previous file with comments | « chrome/browser/history/history_unittest.cc ('k') | chrome/browser/renderer_host/resource_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698