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

Unified Diff: base/metrics/histogram_snapshot_manager.cc

Issue 2362113002: Try to fix gathering of ranges_ptr plus capture checksums. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_snapshot_manager.cc
diff --git a/base/metrics/histogram_snapshot_manager.cc b/base/metrics/histogram_snapshot_manager.cc
index 340505e51977fa8fdee508070c2ee2c508b0d4c9..f28009c436f78d35f76caffd1da4615eb5fdc968 100644
--- a/base/metrics/histogram_snapshot_manager.cc
+++ b/base/metrics/histogram_snapshot_manager.cc
@@ -53,6 +53,8 @@ void HistogramSnapshotManager::PrepareSamples(
for (size_t i = 0; i < ranges->size(); ++i)
ranges_copy.push_back(ranges->range(i));
HistogramBase::Sample* ranges_ptr = &ranges_copy[0];
+ uint32_t ranges_checksum = ranges->checksum();
+ uint32_t ranges_calc_checksum = ranges->CalculateChecksum();
const char* histogram_name = histogram->histogram_name().c_str();
int32_t flags = histogram->flags();
// The checksum should have caught this, so crash separately if it didn't.
@@ -60,7 +62,9 @@ void HistogramSnapshotManager::PrepareSamples(
CHECK(false); // Crash for the bucket order corruption.
// Ensure that compiler keeps around pointers to |histogram| and its
// internal |bucket_ranges_| for any minidumps.
- base::debug::Alias(&ranges_ptr);
+ base::debug::Alias(ranges_ptr);
+ base::debug::Alias(&ranges_checksum);
+ base::debug::Alias(&ranges_calc_checksum);
base::debug::Alias(&histogram_name);
base::debug::Alias(&flags);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698