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

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

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.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc
index 1c960364cf1ca21f7e5f3d29908c741863fd152a..6ac435dc6cb05c57ae7f74a1cc43790b88bab88f 100644
--- a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc
@@ -7,10 +7,10 @@
#include <string>
#include <vector>
-#include "base/callback.h"
#include "base/json/json_writer.h"
#include "chrome/browser/prefs/tracked/pref_hash_store_transaction.h"
#include "chrome/browser/prefs/tracked/tracked_preference_helper.h"
+#include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h"
#include "chrome/browser/safe_browsing/incident_reporting/tracked_preference_incident.h"
#include "chrome/common/safe_browsing/csd.pb.h"
@@ -41,8 +41,10 @@ TPIncident_ValueState MapValueState(
} // namespace
PreferenceValidationDelegate::PreferenceValidationDelegate(
- const AddIncidentCallback& add_incident)
- : add_incident_(add_incident) {
+ Profile* profile,
+ scoped_ptr<IncidentReceiver> incident_receiver)
+ : profile_(profile),
+ incident_receiver_(incident_receiver.Pass()) {
}
PreferenceValidationDelegate::~PreferenceValidationDelegate() {
@@ -64,8 +66,9 @@ void PreferenceValidationDelegate::OnAtomicPreferenceValidation(
incident->clear_atomic_value();
}
incident->set_value_state(proto_value_state);
- add_incident_.Run(make_scoped_ptr(
- new TrackedPreferenceIncident(incident.Pass(), is_personal)));
+ incident_receiver_->AddIncidentForProfile(
+ profile_, make_scoped_ptr(new TrackedPreferenceIncident(incident.Pass(),
+ is_personal)));
}
}
@@ -87,8 +90,9 @@ void PreferenceValidationDelegate::OnSplitPreferenceValidation(
incident->add_split_key(*scan);
}
incident->set_value_state(proto_value_state);
- add_incident_.Run(make_scoped_ptr(
- new TrackedPreferenceIncident(incident.Pass(), is_personal)));
+ incident_receiver_->AddIncidentForProfile(
+ profile_, make_scoped_ptr(new TrackedPreferenceIncident(incident.Pass(),
+ is_personal)));
}
}

Powered by Google App Engine
This is Rietveld 408576698