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

Side by Side Diff: base/metrics/histogram_persistence.h

Issue 1537743006: Persist setup metrics and have Chrome report them during UMA upload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared-histograms
Patch Set: test needs to clear out statistics-recorder before releasing histogram memory Created 4 years, 10 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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 #ifndef BASE_METRICS_HISTOGRAM_PERSISTENCE_H_ 5 #ifndef BASE_METRICS_HISTOGRAM_PERSISTENCE_H_
6 #define BASE_METRICS_HISTOGRAM_PERSISTENCE_H_ 6 #define BASE_METRICS_HISTOGRAM_PERSISTENCE_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/feature_list.h" 9 #include "base/feature_list.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 17 matching lines...) Expand all
28 // be pointers to data held in that space. 28 // be pointers to data held in that space.
29 BASE_EXPORT void SetPersistentHistogramMemoryAllocator( 29 BASE_EXPORT void SetPersistentHistogramMemoryAllocator(
30 PersistentMemoryAllocator* allocator); 30 PersistentMemoryAllocator* allocator);
31 BASE_EXPORT PersistentMemoryAllocator* GetPersistentHistogramMemoryAllocator(); 31 BASE_EXPORT PersistentMemoryAllocator* GetPersistentHistogramMemoryAllocator();
32 32
33 // This access to the persistent allocator is only for testing; it extracts 33 // This access to the persistent allocator is only for testing; it extracts
34 // the current allocator completely. This allows easy creation of histograms 34 // the current allocator completely. This allows easy creation of histograms
35 // within persistent memory segments which can then be extracted and used 35 // within persistent memory segments which can then be extracted and used
36 // in other ways. 36 // in other ways.
37 BASE_EXPORT PersistentMemoryAllocator* 37 BASE_EXPORT PersistentMemoryAllocator*
38 ReleasePersistentHistogramMemoryAllocator(); 38 ReleasePersistentHistogramMemoryAllocatorForTesting();
39 39
40 // Recreate a Histogram from data held in persistent memory. Though this 40 // Recreate a Histogram from data held in persistent memory. Though this
41 // object will be local to the current process, the sample data will be 41 // object will be local to the current process, the sample data will be
42 // shared with all other threads referencing it. This method takes a |ref| 42 // shared with all other threads referencing it. This method takes a |ref|
43 // to the top- level histogram data and the |allocator| on which it is found. 43 // to the top- level histogram data and the |allocator| on which it is found.
44 // This method will return nullptr if any problem is detected with the data. 44 // This method will return nullptr if any problem is detected with the data.
45 // The |allocator| may or may not be the same as the PersistentMemoryAllocator 45 // The |allocator| may or may not be the same as the PersistentMemoryAllocator
46 // set for general use so that this method can be used to extract Histograms 46 // set for general use so that this method can be used to extract Histograms
47 // from persistent memory segments other than the default place that this 47 // from persistent memory segments other than the default place that this
48 // process is creating its own histograms. The caller must take ownership of 48 // process is creating its own histograms. The caller must take ownership of
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // possible for other processes to create histograms in the attached memory 80 // possible for other processes to create histograms in the attached memory
81 // segment; this adds those to the internal list of known histograms to 81 // segment; this adds those to the internal list of known histograms to
82 // avoid creating duplicates that would have to merged during reporting. 82 // avoid creating duplicates that would have to merged during reporting.
83 // Every call to this method resumes from the last entry it saw so it costs 83 // Every call to this method resumes from the last entry it saw so it costs
84 // nothing if nothing new has been added. 84 // nothing if nothing new has been added.
85 void ImportPersistentHistograms(); 85 void ImportPersistentHistograms();
86 86
87 } // namespace base 87 } // namespace base
88 88
89 #endif // BASE_METRICS_HISTOGRAM_PERSISTENCE_H_ 89 #endif // BASE_METRICS_HISTOGRAM_PERSISTENCE_H_
OLDNEW
« no previous file with comments | « no previous file | base/metrics/histogram_persistence.cc » ('j') | base/metrics/histogram_persistence.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698