OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/user_prefs/tracked/pref_hash_filter.h" | 5 #include "components/user_prefs/tracked/pref_hash_filter.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 249 |
250 if (did_reset) { | 250 if (did_reset) { |
251 pref_store_contents->Set(user_prefs::kPreferenceResetTime, | 251 pref_store_contents->Set(user_prefs::kPreferenceResetTime, |
252 new base::Value(base::Int64ToString( | 252 new base::Value(base::Int64ToString( |
253 base::Time::Now().ToInternalValue()))); | 253 base::Time::Now().ToInternalValue()))); |
254 FilterUpdate(user_prefs::kPreferenceResetTime); | 254 FilterUpdate(user_prefs::kPreferenceResetTime); |
255 | 255 |
256 if (!on_reset_on_load_.is_null()) | 256 if (!on_reset_on_load_.is_null()) |
257 on_reset_on_load_.Run(); | 257 on_reset_on_load_.Run(); |
258 } | 258 } |
| 259 on_reset_on_load_.Reset(); |
259 | 260 |
260 UMA_HISTOGRAM_TIMES("Settings.FilterOnLoadTime", | 261 UMA_HISTOGRAM_TIMES("Settings.FilterOnLoadTime", |
261 base::TimeTicks::Now() - checkpoint); | 262 base::TimeTicks::Now() - checkpoint); |
262 | 263 |
263 post_filter_on_load_callback.Run(std::move(pref_store_contents), | 264 post_filter_on_load_callback.Run(std::move(pref_store_contents), |
264 prefs_altered); | 265 prefs_altered); |
265 } | 266 } |
266 | 267 |
267 // static | 268 // static |
268 void PrefHashFilter::ClearFromExternalStore( | 269 void PrefHashFilter::ClearFromExternalStore( |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // which owns the pointers. | 362 // which owns the pointers. |
362 HashStoreContents* raw_contents = hash_store_contents_copy.get(); | 363 HashStoreContents* raw_contents = hash_store_contents_copy.get(); |
363 base::DictionaryValue* raw_changed_paths_macs = changed_paths_macs.get(); | 364 base::DictionaryValue* raw_changed_paths_macs = changed_paths_macs.get(); |
364 | 365 |
365 return std::make_pair( | 366 return std::make_pair( |
366 base::Bind(&ClearFromExternalStore, base::Unretained(raw_contents), | 367 base::Bind(&ClearFromExternalStore, base::Unretained(raw_contents), |
367 base::Unretained(raw_changed_paths_macs)), | 368 base::Unretained(raw_changed_paths_macs)), |
368 base::Bind(&FlushToExternalStore, base::Passed(&hash_store_contents_copy), | 369 base::Bind(&FlushToExternalStore, base::Passed(&hash_store_contents_copy), |
369 base::Passed(&changed_paths_macs))); | 370 base::Passed(&changed_paths_macs))); |
370 } | 371 } |
OLD | NEW |