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

Side by Side Diff: components/prefs/json_pref_store.cc

Issue 2204943002: Integrate registry_hash_store_contents with the rest of tracked prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: upload post dependent-patchset commit Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/prefs/json_pref_store.h" 5 #include "components/prefs/json_pref_store.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 CommitPendingWrite(); 455 CommitPendingWrite();
456 } 456 }
457 457
458 bool JsonPrefStore::SerializeData(std::string* output) { 458 bool JsonPrefStore::SerializeData(std::string* output) {
459 DCHECK(CalledOnValidThread()); 459 DCHECK(CalledOnValidThread());
460 460
461 pending_lossy_write_ = false; 461 pending_lossy_write_ = false;
462 462
463 write_count_histogram_.RecordWriteOccured(); 463 write_count_histogram_.RecordWriteOccured();
464 464
465 if (pref_filter_) 465 if (pref_filter_) {
466 pref_filter_->FilterSerializeData(prefs_.get()); 466 base::Callback<void(bool)> pref_filter_post_write_callback =
467 pref_filter_->FilterSerializeData(prefs_.get());
468 if (!pref_filter_post_write_callback.is_null())
469 RegisterOnNextWriteSynchronousCallback(pref_filter_post_write_callback);
470 }
467 471
468 JSONStringValueSerializer serializer(output); 472 JSONStringValueSerializer serializer(output);
469 // Not pretty-printing prefs shrinks pref file size by ~30%. To obtain 473 // Not pretty-printing prefs shrinks pref file size by ~30%. To obtain
470 // readable prefs for debugging purposes, you can dump your prefs into any 474 // readable prefs for debugging purposes, you can dump your prefs into any
471 // command-line or online JSON pretty printing tool. 475 // command-line or online JSON pretty printing tool.
472 serializer.set_pretty_print(false); 476 serializer.set_pretty_print(false);
473 return serializer.Serialize(*prefs_); 477 return serializer.Serialize(*prefs_);
474 } 478 }
475 479
476 void JsonPrefStore::FinalizeFileRead( 480 void JsonPrefStore::FinalizeFileRead(
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 DCHECK_EQ(31, num_buckets); 598 DCHECK_EQ(31, num_buckets);
595 599
596 // The histogram below is an expansion of the UMA_HISTOGRAM_CUSTOM_COUNTS 600 // The histogram below is an expansion of the UMA_HISTOGRAM_CUSTOM_COUNTS
597 // macro adapted to allow for a dynamically suffixed histogram name. 601 // macro adapted to allow for a dynamically suffixed histogram name.
598 // Note: The factory creates and owns the histogram. 602 // Note: The factory creates and owns the histogram.
599 base::HistogramBase* histogram = base::Histogram::FactoryGet( 603 base::HistogramBase* histogram = base::Histogram::FactoryGet(
600 histogram_name, min_value, max_value, num_buckets, 604 histogram_name, min_value, max_value, num_buckets,
601 base::HistogramBase::kUmaTargetedHistogramFlag); 605 base::HistogramBase::kUmaTargetedHistogramFlag);
602 return histogram; 606 return histogram;
603 } 607 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698