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

Unified Diff: chrome/browser/safe_browsing/download_protection_service.h

Issue 2647323004: Move download attribution right after CheckDownloadUrl (Closed)
Patch Set: address naprker's comments Created 3 years, 11 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: chrome/browser/safe_browsing/download_protection_service.h
diff --git a/chrome/browser/safe_browsing/download_protection_service.h b/chrome/browser/safe_browsing/download_protection_service.h
index e7fee05b4c4adbc2ede1f1289518485c6a5fafc4..9edf4275805a381b9db6b70103e916d52944e96b 100644
--- a/chrome/browser/safe_browsing/download_protection_service.h
+++ b/chrome/browser/safe_browsing/download_protection_service.h
@@ -118,7 +118,7 @@ class DownloadProtectionService {
// delivered asynchronously via the given callback. This method must be
// called on the UI thread, and the callback will also be invoked on the UI
// thread. Pre-condition: !info.download_url_chain.empty().
- virtual void CheckDownloadUrl(const content::DownloadItem& item,
+ virtual void CheckDownloadUrl(content::DownloadItem* item,
const CheckDownloadCallback& callback);
// Returns true iff the download specified by |info| should be scanned by
@@ -223,6 +223,7 @@ class DownloadProtectionService {
private:
class CheckClientDownloadRequest;
class PPAPIDownloadRequest;
+ friend class DownloadSBClient;
friend class DownloadProtectionServiceTest;
friend class DownloadDangerPromptTest;
@@ -295,13 +296,13 @@ class DownloadProtectionService {
// Returns the URL that will be used for download requests.
static GURL GetDownloadRequestUrl();
- // If kDownloadAttribution feature is enabled, identify and add referrer chain
- // info of a download to ClientDownloadRequest proto. This function also
- // records UMA stats of download attribution result.
- void AddReferrerChainToClientDownloadRequest(
+ // If kDownloadAttribution feature is enabled, identify referrer chain info of
+ // a download. This function also records UMA stats of download attribution
+ // result.
+ void IdentifyReferrerChain(
const GURL& download_url,
content::WebContents* web_contents,
- ClientDownloadRequest* out_request);
+ ReferrerChain* out_referrer_chain);
// If kDownloadAttribution feature is enabled, identify referrer chain of the
// PPAPI download based on the frame URL where the download is initiated.
@@ -356,6 +357,8 @@ class DownloadProtectionService {
// Rate of whitelisted downloads we sample to send out download ping.
double whitelist_sample_rate_;
+ base::WeakPtrFactory<DownloadProtectionService> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService);
};
} // namespace safe_browsing

Powered by Google App Engine
This is Rietveld 408576698