summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorrtenneti@google.com <rtenneti@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-10 01:43:23 +0000
committerrtenneti@google.com <rtenneti@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-10 01:43:23 +0000
commit0ad73e927abaf87fe94ab78b048ef41c84e34992 (patch)
tree610fe75ddfe515beb768df5dc2392245bc10dd8a /base
parent11622e70dacc6081adbf00bb08a7532b15116385 (diff)
downloadchromium_src-0ad73e927abaf87fe94ab78b048ef41c84e34992.zip
chromium_src-0ad73e927abaf87fe94ab78b048ef41c84e34992.tar.gz
chromium_src-0ad73e927abaf87fe94ab78b048ef41c84e34992.tar.bz2
Disable getting histogram data from child processes other than the renderer processes.
Store the histogram name in the local variable for debugging purposes when we crash. R=jar TBR=jam BUG=140688 TEST=base (histogram unit tests) and unit_tests. Review URL: https://chromiumcodereview.appspot.com/10831247 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/metrics/histogram_snapshot_manager.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/base/metrics/histogram_snapshot_manager.cc b/base/metrics/histogram_snapshot_manager.cc
index 2812c16..a3c9708 100644
--- a/base/metrics/histogram_snapshot_manager.cc
+++ b/base/metrics/histogram_snapshot_manager.cc
@@ -4,7 +4,10 @@
#include "base/metrics/histogram_snapshot_manager.h"
+#include "base/compiler_specific.h"
+#include "base/debug/alias.h"
#include "base/metrics/statistics_recorder.h"
+#include "base/string_util.h"
using base::Histogram;
using base::StatisticsRecorder;
@@ -44,6 +47,12 @@ void HistogramSnapshotManager::PrepareDelta(const Histogram& histogram) {
int corruption = histogram.FindCorruption(snapshot);
+ char histogram_name_buf[128];
+ base::strlcpy(histogram_name_buf,
+ histogram_name.c_str(),
+ arraysize(histogram_name_buf));
+ base::debug::Alias(histogram_name_buf);
+
// Crash if we detect that our histograms have been overwritten. This may be
// a fair distance from the memory smasher, but we hope to correlate these
// crashes with other events, such as plugins, or usage patterns, etc.