OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/atomicops.h" | 8 #include "base/atomicops.h" |
9 #include "base/base_export.h" | 9 #include "base/base_export.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void* base, | 122 void* base, |
123 size_t size, | 123 size_t size, |
124 size_t page_size, | 124 size_t page_size, |
125 uint64_t id, | 125 uint64_t id, |
126 StringPiece name); | 126 StringPiece name); |
127 static void CreateGlobalAllocatorOnLocalMemory( | 127 static void CreateGlobalAllocatorOnLocalMemory( |
128 size_t size, | 128 size_t size, |
129 uint64_t id, | 129 uint64_t id, |
130 StringPiece name); | 130 StringPiece name); |
131 static void CreateGlobalAllocatorOnSharedMemory( | 131 static void CreateGlobalAllocatorOnSharedMemory( |
| 132 scoped_ptr<SharedMemory> memory, |
132 size_t size, | 133 size_t size, |
133 const SharedMemoryHandle& handle); | 134 uint64_t id, |
| 135 StringPiece name); |
| 136 static void CreateGlobalAllocatorOnSharedMemoryHandle( |
| 137 const SharedMemoryHandle& handle, |
| 138 size_t size); |
134 | 139 |
135 // Import new histograms from the global PersistentHistogramAllocator. It's | 140 // Import new histograms from the global PersistentHistogramAllocator. It's |
136 // possible for other processes to create histograms in the active memory | 141 // possible for other processes to create histograms in the active memory |
137 // segment; this adds those to the internal list of known histograms to | 142 // segment; this adds those to the internal list of known histograms to |
138 // avoid creating duplicates that would have to be merged during reporting. | 143 // avoid creating duplicates that would have to be merged during reporting. |
139 // Every call to this method resumes from the last entry it saw; it costs | 144 // Every call to this method resumes from the last entry it saw; it costs |
140 // nothing if nothing new has been added. | 145 // nothing if nothing new has been added. |
141 static void ImportGlobalHistograms(); | 146 static void ImportGlobalHistograms(); |
142 | 147 |
143 // Histogram containing creation results. Visible for testing. | 148 // Histogram containing creation results. Visible for testing. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // A reference to the last-created histogram in the allocator, used to avoid | 208 // A reference to the last-created histogram in the allocator, used to avoid |
204 // trying to import what was just created. | 209 // trying to import what was just created. |
205 subtle::AtomicWord last_created_ = 0; | 210 subtle::AtomicWord last_created_ = 0; |
206 | 211 |
207 DISALLOW_COPY_AND_ASSIGN(PersistentHistogramAllocator); | 212 DISALLOW_COPY_AND_ASSIGN(PersistentHistogramAllocator); |
208 }; | 213 }; |
209 | 214 |
210 } // namespace base | 215 } // namespace base |
211 | 216 |
212 #endif // BASE_METRICS_HISTOGRAM_PERSISTENCE_H_ | 217 #endif // BASE_METRICS_HISTOGRAM_PERSISTENCE_H_ |
OLD | NEW |