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 "services/preferences/tracked/pref_hash_filter.h" | 5 #include "services/preferences/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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 external_validation_hash_store_transaction.get())) { | 236 external_validation_hash_store_transaction.get())) { |
237 did_reset = true; | 237 did_reset = true; |
238 prefs_altered = true; | 238 prefs_altered = true; |
239 } | 239 } |
240 } | 240 } |
241 if (hash_store_transaction->StampSuperMac()) | 241 if (hash_store_transaction->StampSuperMac()) |
242 prefs_altered = true; | 242 prefs_altered = true; |
243 } | 243 } |
244 | 244 |
245 if (did_reset) { | 245 if (did_reset) { |
246 pref_store_contents->Set(user_prefs::kPreferenceResetTime, | 246 pref_store_contents->SetString( |
247 new base::Value(base::Int64ToString( | 247 user_prefs::kPreferenceResetTime, |
248 base::Time::Now().ToInternalValue()))); | 248 base::Int64ToString(base::Time::Now().ToInternalValue())); |
249 FilterUpdate(user_prefs::kPreferenceResetTime); | 249 FilterUpdate(user_prefs::kPreferenceResetTime); |
250 | 250 |
251 if (reset_on_load_observer_) | 251 if (reset_on_load_observer_) |
252 reset_on_load_observer_->OnResetOnLoad(); | 252 reset_on_load_observer_->OnResetOnLoad(); |
253 } | 253 } |
254 reset_on_load_observer_.reset(); | 254 reset_on_load_observer_.reset(); |
255 | 255 |
256 UMA_HISTOGRAM_TIMES("Settings.FilterOnLoadTime", | 256 UMA_HISTOGRAM_TIMES("Settings.FilterOnLoadTime", |
257 base::TimeTicks::Now() - checkpoint); | 257 base::TimeTicks::Now() - checkpoint); |
258 | 258 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 // which owns the pointers. | 357 // which owns the pointers. |
358 HashStoreContents* raw_contents = hash_store_contents_copy.get(); | 358 HashStoreContents* raw_contents = hash_store_contents_copy.get(); |
359 base::DictionaryValue* raw_changed_paths_macs = changed_paths_macs.get(); | 359 base::DictionaryValue* raw_changed_paths_macs = changed_paths_macs.get(); |
360 | 360 |
361 return std::make_pair( | 361 return std::make_pair( |
362 base::Bind(&ClearFromExternalStore, base::Unretained(raw_contents), | 362 base::Bind(&ClearFromExternalStore, base::Unretained(raw_contents), |
363 base::Unretained(raw_changed_paths_macs)), | 363 base::Unretained(raw_changed_paths_macs)), |
364 base::Bind(&FlushToExternalStore, base::Passed(&hash_store_contents_copy), | 364 base::Bind(&FlushToExternalStore, base::Passed(&hash_store_contents_copy), |
365 base::Passed(&changed_paths_macs))); | 365 base::Passed(&changed_paths_macs))); |
366 } | 366 } |
OLD | NEW |