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

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

Issue 1671933002: Create and pass shared-histogram-allocator from browser to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hsm-merge
Patch Set: addressd more review comments by Alexei; refactored & extended tests Created 4 years, 8 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 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
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
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_
OLDNEW
« no previous file with comments | « no previous file | base/metrics/persistent_histogram_allocator.cc » ('j') | chrome/browser/metrics/subprocess_metrics_provider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698