summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-02 23:32:28 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-02 23:32:28 +0000
commitdd4664afc7b8073b798f406a0513004878e091e1 (patch)
tree0dce47a04cc2185d17037105104093405f63cb3c /chrome/renderer
parent97310d6ea1ceec457157847c2f8b9b06b0d4581e (diff)
downloadchromium_src-dd4664afc7b8073b798f406a0513004878e091e1.zip
chromium_src-dd4664afc7b8073b798f406a0513004878e091e1.tar.gz
chromium_src-dd4664afc7b8073b798f406a0513004878e091e1.tar.bz2
Revert 64687 - Try to detect internal corruption of histogram instances.
Corruptions can include changes in bucket boundaries, large changes in sample counts (in a bucket), etc. We now detect problems, and don't forward the corrupt data any further. This means it won't exit the renderer and go to the browser if corrupt, and it won't exit the browser and be sent up via UMA if corrupt. IF the would-be corruption is caused by a race to snapshot the data, then a later snapshot should get the clean copy, and all data (across the precluded period) will be sent onward. BUG=61281 r=mbelshe Review URL: http://codereview.chromium.org/4174002 TBR=jar@chromium.org Review URL: http://codereview.chromium.org/4349002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64846 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/renderer_histogram_snapshots.cc23
1 files changed, 4 insertions, 19 deletions
diff --git a/chrome/renderer/renderer_histogram_snapshots.cc b/chrome/renderer/renderer_histogram_snapshots.cc
index 6124e04..ae9ee1d 100644
--- a/chrome/renderer/renderer_histogram_snapshots.cc
+++ b/chrome/renderer/renderer_histogram_snapshots.cc
@@ -52,33 +52,17 @@ void RendererHistogramSnapshots::UploadAllHistrograms(int sequence_number) {
sequence_number, pickled_histograms));
}
-// Extract snapshot data, remember what we've seen so far, and then send off the
-// delta to the browser.
+// Extract snapshot data and then send it off the the Browser process
+// to save it.
void RendererHistogramSnapshots::UploadHistrogram(
const Histogram& histogram,
HistogramPickledList* pickled_histograms) {
+
// Get up-to-date snapshot of sample stats.
Histogram::SampleSet snapshot;
histogram.SnapshotSample(&snapshot);
const std::string& histogram_name = histogram.histogram_name();
- int corruption = histogram.FindCorruption(snapshot);
- if (corruption) {
- NOTREACHED();
- // Don't send corrupt data to the browser.
- UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesRenderer",
- corruption, Histogram::NEVER_EXCEEDED_VALUE);
- typedef std::map<std::string, int> ProblemMap;
- static ProblemMap* inconsistencies = new ProblemMap;
- int old_corruption = (*inconsistencies)[histogram_name];
- if (old_corruption == (corruption | old_corruption))
- return; // We've already seen this corruption for this histogram.
- (*inconsistencies)[histogram_name] |= corruption;
- UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesRendererUnique",
- corruption, Histogram::NEVER_EXCEEDED_VALUE);
- return;
- }
-
// Find the already sent stats, or create an empty set.
LoggedSampleMap::iterator it = logged_samples_.find(histogram_name);
Histogram::SampleSet* already_logged;
@@ -105,6 +89,7 @@ void RendererHistogramSnapshots::UploadHistogramDelta(
const Histogram& histogram,
const Histogram::SampleSet& snapshot,
HistogramPickledList* pickled_histograms) {
+
DCHECK(0 != snapshot.TotalCount());
snapshot.CheckSize(histogram);