summaryrefslogtreecommitdiffstats
path: root/base/BUILD.gn
diff options
context:
space:
mode:
authorbcwhite <bcwhite@chromium.org>2016-03-15 19:37:45 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-16 02:38:44 +0000
commit33d95806addac4c84a88eb8561ea424ef2097b6d (patch)
tree393f1029aa624f83d61ebe8c4cc88bd379824fb9 /base/BUILD.gn
parentab4d700467b65a395a64c02d1a7d2777950ec0cd (diff)
downloadchromium_src-33d95806addac4c84a88eb8561ea424ef2097b6d.zip
chromium_src-33d95806addac4c84a88eb8561ea424ef2097b6d.tar.gz
chromium_src-33d95806addac4c84a88eb8561ea424ef2097b6d.tar.bz2
Refactor histogram_persistence to be a class.
The number of top-level functions was getting too large and impeding development of other features due to the previous lack of OO design. The code is largely unchanged, just moved into a stateful class and reordered to match the public/private sections of the class. Two other CLs are included here because they fit well with the refactoring: https://codereview.chromium.org/1689833002/ Add ownership-transfer to histogram management calls. This CL changes the interface to use scoped_ptr to explicitly document, with std::move, when the transfer of ownership is taking place. https://codereview.chromium.org/1731453002/ Reduce histogram creation time by avoiding import of those just created. Attempting to import histograms in the persistent memory segment is necessary because it could be shared and thus have other processes creating objects within it. However, there's no need to import those objects that this process created. The simple method remembering the "reference" of the last histogram created in the allocator catches almost all cases and reduces histogram creation time by 40%. BUG=546019 TBR=grt,thakis grt: setup/installer_metrics.cc (no logic changes) thakis: gn & gyp changes for new files Review URL: https://codereview.chromium.org/1738063002 Cr-Commit-Position: refs/heads/master@{#381386}
Diffstat (limited to 'base/BUILD.gn')
-rw-r--r--base/BUILD.gn5
1 files changed, 3 insertions, 2 deletions
diff --git a/base/BUILD.gn b/base/BUILD.gn
index cfe258b..1fcd718 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -526,14 +526,14 @@ component("base") {
"metrics/histogram_delta_serialization.h",
"metrics/histogram_flattener.h",
"metrics/histogram_macros.h",
- "metrics/histogram_persistence.cc",
- "metrics/histogram_persistence.h",
"metrics/histogram_samples.cc",
"metrics/histogram_samples.h",
"metrics/histogram_snapshot_manager.cc",
"metrics/histogram_snapshot_manager.h",
"metrics/metrics_hashes.cc",
"metrics/metrics_hashes.h",
+ "metrics/persistent_histogram_allocator.cc",
+ "metrics/persistent_histogram_allocator.h",
"metrics/persistent_memory_allocator.cc",
"metrics/persistent_memory_allocator.h",
"metrics/sample_map.cc",
@@ -1738,6 +1738,7 @@ test("base_unittests") {
"metrics/histogram_snapshot_manager_unittest.cc",
"metrics/histogram_unittest.cc",
"metrics/metrics_hashes_unittest.cc",
+ "metrics/persistent_histogram_allocator_unittest.cc",
"metrics/persistent_memory_allocator_unittest.cc",
"metrics/sample_map_unittest.cc",
"metrics/sample_vector_unittest.cc",