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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h

Issue 663023007: Include high-fidelity metadata about a download in incident reports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: added DCHECK Created 6 years, 1 month 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/incident_reporting/incident_reporting_service.h
diff --git a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h
index 9434e66e72ccde8aad310b31e890e215347459b1..b824b36e10274a8ac2990746a325665aa18e5325 100644
--- a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h
+++ b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h
@@ -18,9 +18,11 @@
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
+#include "chrome/browser/safe_browsing/download_protection_service.h"
#include "chrome/browser/safe_browsing/incident_reporting/add_incident_callback.h"
#include "chrome/browser/safe_browsing/incident_reporting/delayed_analysis_callback.h"
#include "chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner.h"
+#include "chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.h"
#include "chrome/browser/safe_browsing/incident_reporting/incident_report_uploader.h"
#include "chrome/browser/safe_browsing/incident_reporting/last_download_finder.h"
#include "content/public/browser/notification_observer.h"
@@ -36,6 +38,7 @@ class TaskRunner;
}
namespace content {
+class DownloadManager;
class NotificationDetails;
class NotificationSource;
}
@@ -46,6 +49,7 @@ class URLRequestContextGetter;
namespace safe_browsing {
+class ClientDownloadRequest;
class ClientIncidentReport;
class ClientIncidentReport_DownloadDetails;
class ClientIncidentReport_EnvironmentData;
@@ -90,6 +94,10 @@ class IncidentReportingService : public content::NotificationObserver {
// Registers |callback| to be run after some delay following process launch.
void RegisterDelayedAnalysisCallback(const DelayedAnalysisCallback& callback);
+ // Adds |download_manager| to the set monitored for client download request
+ // storage.
+ void AddDownloadManager(content::DownloadManager* download_manager);
+
protected:
// A pointer to a function that populates a protobuf with environment data.
typedef void (*CollectEnvironmentDataFn)(
@@ -232,6 +240,10 @@ class IncidentReportingService : public content::NotificationObserver {
IncidentReportUploader::Result result,
scoped_ptr<ClientIncidentResponse> response);
+ // DownloadProtectionService::ClientDownloadRequestCallback implementation.
+ void OnClientDownloadRequest(content::DownloadItem* download,
+ const ClientDownloadRequest* request);
+
// content::NotificationObserver methods.
void Observe(int type,
const content::NotificationSource& source,
@@ -260,6 +272,11 @@ class IncidentReportingService : public content::NotificationObserver {
// Registrar for observing profile lifecycle notifications.
content::NotificationRegistrar notification_registrar_;
+ // A subscription for ClientDownloadRequests, used to persist them for later
+ // use.
+ DownloadProtectionService::ClientDownloadRequestSubscription
+ client_download_request_subscription_;
+
// True when the asynchronous environment collection task has been fired off
// but has not yet completed.
bool environment_collection_pending_;
@@ -296,6 +313,8 @@ class IncidentReportingService : public content::NotificationObserver {
// Callbacks registered for performing delayed analysis.
DelayedCallbackRunner delayed_analysis_callbacks_;
+ DownloadMetadataManager download_metadata_manager_;
+
// The collection of uploads in progress.
ScopedVector<UploadContext> uploads_;

Powered by Google App Engine
This is Rietveld 408576698