Chromium Code Reviews| 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() { |