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

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

Issue 1342873002: Small logic change to StateStore::Transaction::ClearAll (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/incident_reporting/state_store.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/state_store.cc b/chrome/browser/safe_browsing/incident_reporting/state_store.cc
index 0b5768ea53ff9292a2863f5e8f02a3174292b54e..8d44d30aaa9253b8df65147feeff36274b603144 100644
--- a/chrome/browser/safe_browsing/incident_reporting/state_store.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/state_store.cc
@@ -64,12 +64,9 @@ void StateStore::Transaction::ClearForType(IncidentType type) {
}
void StateStore::Transaction::ClearAll() {
grt (UTC plus 2) 2015/09/14 18:42:39 looks like there's no unittest for this. could you
proberge 2015/09/14 19:59:52 Done.
- if (pref_update_)
- pref_update_.reset();
- if (store_->incidents_sent_) {
- store_->incidents_sent_ = nullptr;
- store_->profile_->GetPrefs()->ClearPref(prefs::kSafeBrowsingIncidentsSent);
- }
+ // Clear the preference if it exists and contains any values.
+ if (store_->incidents_sent_ && !store_->incidents_sent_->empty())
+ GetPrefDict()->Clear();
}
base::DictionaryValue* StateStore::Transaction::GetPrefDict() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698