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

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

Issue 891793002: Take a Profile when adding an incident to the incident reporting service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: this time Created 5 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/incident_reporting/preference_validation_delegate.h
diff --git a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.h b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.h
index 6516c0c6bf85ff8a33ef264d824010aae537f498..1fb789e8016eec8040461f2812acbbe18a704fdc 100644
--- a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.h
+++ b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.h
@@ -5,21 +5,25 @@
#ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PREFERENCE_VALIDATION_DELEGATE_H_
#define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PREFERENCE_VALIDATION_DELEGATE_H_
-#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h"
-#include "chrome/browser/safe_browsing/incident_reporting/add_incident_callback.h"
+
+class Profile;
namespace safe_browsing {
+class IncidentReceiver;
+
// A preference validation delegate that adds incidents to a given receiver
-// for preference validation failures.
+// for preference validation failures. The profile for which the delegate
+// operates must outlive the delegate itself.
class PreferenceValidationDelegate
: public TrackedPreferenceValidationDelegate {
public:
- explicit PreferenceValidationDelegate(
- const AddIncidentCallback& add_incident);
+ PreferenceValidationDelegate(Profile* profile,
+ scoped_ptr<IncidentReceiver> incident_receiver);
~PreferenceValidationDelegate() override;
private:
@@ -36,7 +40,8 @@ class PreferenceValidationDelegate
PrefHashStoreTransaction::ValueState value_state,
bool is_personal) override;
- AddIncidentCallback add_incident_;
+ Profile* profile_;
+ scoped_ptr<IncidentReceiver> incident_receiver_;
DISALLOW_COPY_AND_ASSIGN(PreferenceValidationDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698