Commit c034c303 authored by Daniel Rubery's avatar Daniel Rubery Committed by Chromium LUCI CQ

Create DownloadRequestMaker to populate download pings

This CL refactors the CheckClientDownloadRequestBase into two separate
classes. The CheckClientDownloadRequestBase is responsible for request
logic, such as checking the allowlist and networking operations, while
the DownloadRequestMaker is responsible for assembling the actual
request proto.

Bug: 1165815

Change-Id: Iaaa43ddf65a9c808f2d50bb86800c9667f5e5d7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2623708Reviewed-by: default avatarXinghui Lu <xinghuilu@chromium.org>
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843085}
parent 9000e7fa
......@@ -184,6 +184,8 @@ static_library("safe_browsing") {
"download_protection/download_protection_util.h",
"download_protection/download_reporter.cc",
"download_protection/download_reporter.h",
"download_protection/download_request_maker.cc",
"download_protection/download_request_maker.h",
"download_protection/download_url_sb_client.cc",
"download_protection/download_url_sb_client.h",
"download_protection/file_analyzer.cc",
......
......@@ -111,15 +111,12 @@ CheckClientDownloadRequest::CheckClientDownloadRequest(
: CheckClientDownloadRequestBase(
item->GetURL(),
item->GetTargetFilePath(),
item->GetFullPath(),
{item->GetTabUrl(), item->GetTabReferrerUrl()},
item->GetMimeType(),
item->GetHash(),
content::DownloadItemUtils::GetBrowserContext(item),
callback,
service,
std::move(database_manager),
std::move(binary_feature_extractor)),
std::make_unique<DownloadRequestMaker>(binary_feature_extractor,
item)),
item_(item),
callback_(callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
......@@ -154,8 +151,7 @@ void CheckClientDownloadRequest::OnDownloadUpdated(
bool CheckClientDownloadRequest::IsSupportedDownload(
const download::DownloadItem& item,
const base::FilePath& target_path,
DownloadCheckResultReason* reason,
ClientDownloadRequest::DownloadType* type) {
DownloadCheckResultReason* reason) {
if (item.GetUrlChain().empty()) {
*reason = REASON_EMPTY_URL_CHAIN;
return false;
......@@ -181,7 +177,6 @@ bool CheckClientDownloadRequest::IsSupportedDownload(
*reason = REASON_NOT_BINARY_FILE;
return false;
}
*type = download_type_util::GetDownloadType(target_path);
return true;
}
......@@ -191,9 +186,8 @@ CheckClientDownloadRequest::~CheckClientDownloadRequest() {
}
bool CheckClientDownloadRequest::IsSupportedDownload(
DownloadCheckResultReason* reason,
ClientDownloadRequest::DownloadType* type) {
return IsSupportedDownload(*item_, item_->GetTargetFilePath(), reason, type);
DownloadCheckResultReason* reason) {
return IsSupportedDownload(*item_, item_->GetTargetFilePath(), reason);
}
content::BrowserContext* CheckClientDownloadRequest::GetBrowserContext() const {
......@@ -204,46 +198,6 @@ bool CheckClientDownloadRequest::IsCancelled() {
return item_->GetState() == download::DownloadItem::CANCELLED;
}
void CheckClientDownloadRequest::PopulateRequest(
ClientDownloadRequest* request) {
request->mutable_digests()->set_sha256(item_->GetHash());
request->set_length(item_->GetReceivedBytes());
for (size_t i = 0; i < item_->GetUrlChain().size(); ++i) {
ClientDownloadRequest::Resource* resource = request->add_resources();
resource->set_url(SanitizeUrl(item_->GetUrlChain()[i]));
if (i == item_->GetUrlChain().size() - 1) {
// The last URL in the chain is the download URL.
resource->set_type(ClientDownloadRequest::DOWNLOAD_URL);
resource->set_referrer(SanitizeUrl(item_->GetReferrerUrl()));
DVLOG(2) << "dl url " << resource->url();
if (!item_->GetRemoteAddress().empty()) {
resource->set_remote_ip(item_->GetRemoteAddress());
DVLOG(2) << " dl url remote addr: " << resource->remote_ip();
}
DVLOG(2) << "dl referrer " << resource->referrer();
} else {
DVLOG(2) << "dl redirect " << i << " " << resource->url();
resource->set_type(ClientDownloadRequest::DOWNLOAD_REDIRECT);
}
}
request->set_user_initiated(item_->HasUserGesture());
auto* referrer_chain_data = static_cast<ReferrerChainData*>(
item_->GetUserData(ReferrerChainData::kDownloadReferrerChainDataKey));
if (referrer_chain_data &&
!referrer_chain_data->GetReferrerChain()->empty()) {
request->mutable_referrer_chain()->Swap(
referrer_chain_data->GetReferrerChain());
request->mutable_referrer_chain_options()
->set_recent_navigations_to_collect(
referrer_chain_data->recent_navigations_to_collect());
UMA_HISTOGRAM_COUNTS_100(
"SafeBrowsing.ReferrerURLChainSize.DownloadAttribution",
referrer_chain_data->referrer_chain_length());
}
}
base::WeakPtr<CheckClientDownloadRequestBase>
CheckClientDownloadRequest::GetWeakPtr() {
return weakptr_factory_.GetWeakPtr();
......@@ -253,6 +207,9 @@ void CheckClientDownloadRequest::NotifySendRequest(
const ClientDownloadRequest* request) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
service()->client_download_request_callbacks_.Notify(item_, request);
UMA_HISTOGRAM_COUNTS_100(
"SafeBrowsing.ReferrerURLChainSize.DownloadAttribution",
request->referrer_chain().size());
}
void CheckClientDownloadRequest::SetDownloadPingToken(
......
......@@ -43,16 +43,13 @@ class CheckClientDownloadRequest : public CheckClientDownloadRequestBase,
static bool IsSupportedDownload(const download::DownloadItem& item,
const base::FilePath& target_path,
DownloadCheckResultReason* reason,
ClientDownloadRequest::DownloadType* type);
DownloadCheckResultReason* reason);
private:
// CheckClientDownloadRequestBase overrides:
bool IsSupportedDownload(DownloadCheckResultReason* reason,
ClientDownloadRequest::DownloadType* type) override;
bool IsSupportedDownload(DownloadCheckResultReason* reason) override;
content::BrowserContext* GetBrowserContext() const override;
bool IsCancelled() override;
void PopulateRequest(ClientDownloadRequest* request) override;
base::WeakPtr<CheckClientDownloadRequestBase> GetWeakPtr() override;
void NotifySendRequest(const ClientDownloadRequest* request) override;
......
......@@ -19,10 +19,10 @@
#include "build/build_config.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h"
#include "chrome/browser/safe_browsing/download_protection/download_request_maker.h"
#include "chrome/browser/safe_browsing/download_protection/file_analyzer.h"
#include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.h"
#include "chrome/browser/safe_browsing/ui_manager.h"
#include "chrome/common/safe_browsing/binary_feature_extractor.h"
#include "chrome/services/file_util/public/cpp/sandboxed_rar_analyzer.h"
#include "chrome/services/file_util/public/cpp/sandboxed_zip_analyzer.h"
#include "components/history/core/browser/history_service.h"
......@@ -44,24 +44,14 @@ namespace safe_browsing {
class CheckClientDownloadRequestBase {
public:
// URL and referrer of the window the download was started from.
struct TabUrls {
GURL url;
GURL referrer;
};
CheckClientDownloadRequestBase(
GURL source_url,
base::FilePath target_file_path,
base::FilePath full_path,
TabUrls tab_urls,
std::string mime_type,
std::string hash,
content::BrowserContext* browser_context,
CheckDownloadCallback callback,
DownloadProtectionService* service,
scoped_refptr<SafeBrowsingDatabaseManager> database_manager,
scoped_refptr<BinaryFeatureExtractor> binary_feature_extractor);
std::unique_ptr<DownloadRequestMaker> download_request_maker);
virtual ~CheckClientDownloadRequestBase();
void Start();
......@@ -69,11 +59,6 @@ class CheckClientDownloadRequestBase {
DownloadProtectionService* service() const { return service_; }
protected:
// Prepares URLs to be put into a ping message. Currently this just shortens
// data: URIs, other URLs are included verbatim. If this is a sampled binary,
// we'll send a light-ping which strips PII from the URL.
std::string SanitizeUrl(const GURL& url) const;
// Subclasses can call this method to mark the request as finished (for
// example because the download was cancelled) before the safe browsing
// check has completed. This method can end up deleting |this|.
......@@ -89,30 +74,18 @@ class CheckClientDownloadRequestBase {
bool IsDownloadManuallyBlacklisted(const ClientDownloadRequest& request);
void OnUrlWhitelistCheckDone(bool is_whitelisted);
// Performs file feature extraction and SafeBrowsing ping for downloads that
// don't match the URL whitelist.
void AnalyzeFile();
void OnFileFeatureExtractionDone(FileAnalyzer::Results results);
void OnRequestBuilt(std::unique_ptr<ClientDownloadRequest> request_proto);
void StartTimeout();
void OnCertificateWhitelistCheckDone(bool is_whitelisted);
void GetTabRedirects();
void OnGotTabRedirects(history::RedirectList redirect_list);
void SendRequest();
void OnURLLoaderComplete(std::unique_ptr<std::string> response_body);
virtual bool IsSupportedDownload(
DownloadCheckResultReason* reason,
ClientDownloadRequest::DownloadType* type) = 0;
virtual bool IsSupportedDownload(DownloadCheckResultReason* reason) = 0;
virtual content::BrowserContext* GetBrowserContext() const = 0;
virtual bool IsCancelled() = 0;
virtual base::WeakPtr<CheckClientDownloadRequestBase> GetWeakPtr() = 0;
// Called to populate any data in the request that is specific for the type of
// check being done. Most importantly this method is expected to set the hash
// and size of the download, add DOWNLOAD_URL and DOWNLOAD_REDIRECT
// resources to the request, and set the referrer chain.
virtual void PopulateRequest(ClientDownloadRequest* request) = 0;
// Called right before a network request is send to the server.
virtual void NotifySendRequest(const ClientDownloadRequest* request) = 0;
......@@ -159,16 +132,14 @@ class CheckClientDownloadRequestBase {
// file being whitelisted by policy
virtual bool IsWhitelistedByPolicy() const = 0;
// For sampled unsupported file types, replaces all URLs in
// |client_download_request_| with their origin.
void SanitizeRequest();
// Source URL being downloaded from. This shuold always be set, but could be
// for example an artificial blob: URL if there is no source URL.
const GURL source_url_;
const base::FilePath target_file_path_;
const base::FilePath full_path_;
// URL and referrer of the window the download was started from.
const GURL tab_url_;
const GURL tab_referrer_url_;
// URL chain of redirects leading to (but not including) |tab_url|.
std::vector<GURL> tab_redirects_;
CheckDownloadCallback callback_;
......@@ -178,52 +149,24 @@ class CheckClientDownloadRequestBase {
base::CancelableOnceClosure timeout_closure_;
std::unique_ptr<network::SimpleURLLoader> loader_;
std::unique_ptr<ClientDownloadRequest> client_download_request_;
std::string client_download_request_data_;
bool archived_executable_ = false;
FileAnalyzer::ArchiveValid archive_is_valid_ =
FileAnalyzer::ArchiveValid::UNSET;
#if defined(OS_MAC)
std::unique_ptr<std::vector<uint8_t>> disk_image_signature_;
google::protobuf::RepeatedPtrField<
ClientDownloadRequest_DetachedCodeSignature>
detached_code_signatures_;
#endif
ClientDownloadRequest_SignatureInfo signature_info_;
std::unique_ptr<ClientDownloadRequest_ImageHeaders> image_headers_;
ArchivedBinaries archived_binaries_;
DownloadProtectionService* const service_;
const scoped_refptr<BinaryFeatureExtractor> binary_feature_extractor_;
const scoped_refptr<SafeBrowsingDatabaseManager> database_manager_;
const bool pingback_enabled_;
const std::unique_ptr<FileAnalyzer> file_analyzer_ =
std::make_unique<FileAnalyzer>(binary_feature_extractor_);
ClientDownloadRequest::DownloadType type_ =
ClientDownloadRequest::WIN_EXECUTABLE;
base::CancelableTaskTracker request_tracker_; // For HistoryService lookup.
base::TimeTicks start_time_ = base::TimeTicks::Now(); // Used for stats.
base::TimeTicks timeout_start_time_;
base::TimeTicks request_start_time_;
bool skipped_url_whitelist_ = false;
bool skipped_certificate_whitelist_ = false;
bool sampled_unsupported_file_ = false;
bool is_extended_reporting_ = false;
bool is_incognito_ = false;
bool is_under_advanced_protection_ = false;
bool is_enhanced_protection_ = false;
int file_count_;
int directory_count_;
// The mime type of the download, if known.
std::string mime_type_;
// The hash of the download, if known.
std::string hash_;
// The token fetcher used to attach OAuth access tokens to requests for
// appropriately consented users.
std::unique_ptr<SafeBrowsingTokenFetcher> token_fetcher_;
......@@ -231,6 +174,9 @@ class CheckClientDownloadRequestBase {
// The OAuth access token for the user profile, if needed in the request.
std::string access_token_;
// Used to create the download request proto.
std::unique_ptr<DownloadRequestMaker> download_request_maker_;
DISALLOW_COPY_AND_ASSIGN(CheckClientDownloadRequestBase);
}; // namespace safe_browsing
......
......@@ -27,50 +27,22 @@ namespace safe_browsing {
using content::BrowserThread;
namespace {
GURL GetDownloadUrl(const GURL& frame_url) {
// Regular blob: URLs are of the form
// "blob:https://my-origin.com/def07373-cbd8-49d2-9ef7-20b071d34a1a". To make
// these URLs distinguishable from those we use a fixed string rather than a
// random UUID.
return GURL("blob:" + frame_url.GetOrigin().spec() +
"native-file-system-write");
}
CheckClientDownloadRequestBase::TabUrls TabUrlsFromWebContents(
content::WebContents* web_contents) {
CheckClientDownloadRequestBase::TabUrls result;
if (web_contents) {
content::NavigationEntry* entry =
web_contents->GetController().GetVisibleEntry();
if (entry) {
result.url = entry->GetURL();
result.referrer = entry->GetReferrer().url;
}
}
return result;
}
} // namespace
CheckNativeFileSystemWriteRequest::CheckNativeFileSystemWriteRequest(
std::unique_ptr<content::NativeFileSystemWriteItem> item,
CheckDownloadCallback callback,
DownloadProtectionService* service,
scoped_refptr<SafeBrowsingDatabaseManager> database_manager,
scoped_refptr<BinaryFeatureExtractor> binary_feature_extractor)
: CheckClientDownloadRequestBase(GetDownloadUrl(item->frame_url),
item->target_file_path,
item->full_path,
TabUrlsFromWebContents(item->web_contents),
"application/octet-stream",
item->sha256_hash,
item->browser_context,
std::move(callback),
service,
std::move(database_manager),
std::move(binary_feature_extractor)),
: CheckClientDownloadRequestBase(
GetFileSystemAccessDownloadUrl(item->frame_url),
item->target_file_path,
item->browser_context,
std::move(callback),
service,
std::move(database_manager),
std::make_unique<DownloadRequestMaker>(binary_feature_extractor,
service,
*item)),
item_(std::move(item)),
referrer_chain_data_(service->IdentifyReferrerChain(*item_)) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
......@@ -80,14 +52,12 @@ CheckNativeFileSystemWriteRequest ::~CheckNativeFileSystemWriteRequest() =
default;
bool CheckNativeFileSystemWriteRequest::IsSupportedDownload(
DownloadCheckResultReason* reason,
ClientDownloadRequest::DownloadType* type) {
DownloadCheckResultReason* reason) {
if (!FileTypePolicies::GetInstance()->IsCheckedBinaryFile(
item_->target_file_path)) {
*reason = REASON_NOT_BINARY_FILE;
return false;
}
*type = download_type_util::GetDownloadType(item_->target_file_path);
return true;
}
......@@ -100,33 +70,6 @@ bool CheckNativeFileSystemWriteRequest::IsCancelled() {
return false;
}
void CheckNativeFileSystemWriteRequest::PopulateRequest(
ClientDownloadRequest* request) {
request->mutable_digests()->set_sha256(item_->sha256_hash);
request->set_length(item_->size);
{
ClientDownloadRequest::Resource* resource = request->add_resources();
resource->set_url(SanitizeUrl(GetDownloadUrl(item_->frame_url)));
resource->set_type(ClientDownloadRequest::DOWNLOAD_URL);
if (item_->frame_url.is_valid())
resource->set_referrer(SanitizeUrl(item_->frame_url));
}
request->set_user_initiated(item_->has_user_gesture);
if (referrer_chain_data_ &&
!referrer_chain_data_->GetReferrerChain()->empty()) {
request->mutable_referrer_chain()->Swap(
referrer_chain_data_->GetReferrerChain());
request->mutable_referrer_chain_options()
->set_recent_navigations_to_collect(
referrer_chain_data_->recent_navigations_to_collect());
UMA_HISTOGRAM_COUNTS_100(
"SafeBrowsing.ReferrerURLChainSize.NativeFileSystemWriteAttribution",
referrer_chain_data_->referrer_chain_length());
}
}
base::WeakPtr<CheckClientDownloadRequestBase>
CheckNativeFileSystemWriteRequest::GetWeakPtr() {
return weakptr_factory_.GetWeakPtr();
......@@ -135,6 +78,9 @@ CheckNativeFileSystemWriteRequest::GetWeakPtr() {
void CheckNativeFileSystemWriteRequest::NotifySendRequest(
const ClientDownloadRequest* request) {
service()->native_file_system_write_request_callbacks_.Notify(request);
UMA_HISTOGRAM_COUNTS_100(
"SafeBrowsing.ReferrerURLChainSize.NativeFileSystemWriteAttribution",
request->referrer_chain().size());
}
void CheckNativeFileSystemWriteRequest::SetDownloadPingToken(
......
......@@ -36,11 +36,9 @@ class CheckNativeFileSystemWriteRequest
private:
// CheckClientDownloadRequestBase overrides:
bool IsSupportedDownload(DownloadCheckResultReason* reason,
ClientDownloadRequest::DownloadType* type) override;
bool IsSupportedDownload(DownloadCheckResultReason* reason) override;
content::BrowserContext* GetBrowserContext() const override;
bool IsCancelled() override;
void PopulateRequest(ClientDownloadRequest* request) override;
base::WeakPtr<CheckClientDownloadRequestBase> GetWeakPtr() override;
void NotifySendRequest(const ClientDownloadRequest* request) override;
......
......@@ -27,10 +27,12 @@
#include "chrome/browser/safe_browsing/download_protection/deep_scanning_request.h"
#include "chrome/browser/safe_browsing/download_protection/download_feedback_service.h"
#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h"
#include "chrome/browser/safe_browsing/download_protection/download_request_maker.h"
#include "chrome/browser/safe_browsing/download_protection/download_url_sb_client.h"
#include "chrome/browser/safe_browsing/download_protection/ppapi_download_request.h"
#include "chrome/browser/safe_browsing/services_delegate.h"
#include "chrome/common/safe_browsing/binary_feature_extractor.h"
#include "chrome/common/safe_browsing/download_type_util.h"
#include "chrome/common/url_constants.h"
#include "components/download/public/common/download_item.h"
#include "components/google/core/common/google_util.h"
......@@ -238,13 +240,12 @@ bool DownloadProtectionService::IsSupportedDownload(
const download::DownloadItem& item,
const base::FilePath& target_path) const {
DownloadCheckResultReason reason = REASON_MAX;
ClientDownloadRequest::DownloadType type =
ClientDownloadRequest::WIN_EXECUTABLE;
// TODO(nparker): Remove the CRX check here once can support
// UNKNOWN types properly. http://crbug.com/581044
return (CheckClientDownloadRequest::IsSupportedDownload(item, target_path,
&reason, &type) &&
(ClientDownloadRequest::CHROME_EXTENSION != type));
&reason) &&
download_type_util::GetDownloadType(target_path) !=
ClientDownloadRequest::CHROME_EXTENSION);
}
void DownloadProtectionService::CheckPPAPIDownloadRequest(
......
......@@ -58,6 +58,7 @@ class CheckClientDownloadRequest;
class CheckClientDownloadRequestBase;
class CheckNativeFileSystemWriteRequest;
class ClientDownloadRequest;
class DownloadRequestMaker;
class DownloadFeedbackService;
class PPAPIDownloadRequest;
......@@ -213,6 +214,7 @@ class DownloadProtectionService {
friend class CheckClientDownloadRequest;
friend class CheckNativeFileSystemWriteRequest;
friend class DeepScanningRequest;
friend class DownloadRequestMaker;
FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest,
TestDownloadRequestTimeout);
......
......@@ -8,6 +8,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "net/cert/x509_util.h"
#include "url/gurl.h"
namespace safe_browsing {
......@@ -92,4 +93,13 @@ void GetCertificateWhitelistStrings(
}
}
GURL GetFileSystemAccessDownloadUrl(const GURL& frame_url) {
// Regular blob: URLs are of the form
// "blob:https://my-origin.com/def07373-cbd8-49d2-9ef7-20b071d34a1a". To make
// these URLs distinguishable from those we use a fixed string rather than a
// random UUID.
return GURL("blob:" + frame_url.GetOrigin().spec() +
"native-file-system-write");
}
} // namespace safe_browsing
......@@ -143,6 +143,8 @@ void GetCertificateWhitelistStrings(
const net::X509Certificate& issuer,
std::vector<std::string>* whitelist_strings);
GURL GetFileSystemAccessDownloadUrl(const GURL& frame_url);
} // namespace safe_browsing
#endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_DOWNLOAD_PROTECTION_UTIL_H_
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_DOWNLOAD_REQUEST_MAKER_H_
#define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_DOWNLOAD_REQUEST_MAKER_H_
#include <memory>
#include "base/callback.h"
#include "chrome/browser/safe_browsing/download_protection/file_analyzer.h"
#include "components/download/public/common/download_item.h"
#include "components/history/core/browser/history_service.h"
#include "components/safe_browsing/core/proto/csd.pb.h"
#include "content/public/browser/native_file_system_write_item.h"
namespace safe_browsing {
class DownloadProtectionService;
// This class encapsulate the process of populating all the fields in a Safe
// Browsing download ping.
class DownloadRequestMaker {
public:
using Callback =
base::OnceCallback<void(std::unique_ptr<ClientDownloadRequest>)>;
// URL and referrer of the window the download was started from.
struct TabUrls {
GURL url;
GURL referrer;
};
DownloadRequestMaker(
scoped_refptr<BinaryFeatureExtractor> binary_feature_extractor,
download::DownloadItem* item);
DownloadRequestMaker(
scoped_refptr<BinaryFeatureExtractor> binary_feature_extractor,
DownloadProtectionService* service,
const content::NativeFileSystemWriteItem& item);
~DownloadRequestMaker();
// Starts filling in fields in the download ping. Will run the callback with
// the fully-populated ping.
void Start(Callback callback);
private:
// Callback when |file_analyzer_| is done analyzing the download.
void OnFileFeatureExtractionDone(FileAnalyzer::Results results);
// Helper function to get the tab redirects from the history service.
void GetTabRedirects();
// Callback when the history service has retrieved the tab redirects.
void OnGotTabRedirects(history::RedirectList redirect_list);
content::BrowserContext* browser_context_;
std::unique_ptr<ClientDownloadRequest> request_;
const scoped_refptr<BinaryFeatureExtractor> binary_feature_extractor_;
const std::unique_ptr<FileAnalyzer> file_analyzer_ =
std::make_unique<FileAnalyzer>(binary_feature_extractor_);
base::CancelableTaskTracker request_tracker_; // For HistoryService lookup.
// The current URL for the WebContents that initiated the download, and its
// referrer.
TabUrls tab_urls_;
// The ultimate destination for the download.
const base::FilePath target_file_path_;
// The current path to the file contents.
const base::FilePath full_path_;
Callback callback_;
base::WeakPtrFactory<DownloadRequestMaker> weakptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(DownloadRequestMaker);
};
} // namespace safe_browsing
#endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_DOWNLOAD_REQUEST_MAKER_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment