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.cc

Issue 1768563002: Revert of Collect information about failing histogram factory calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | base/metrics/histogram_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.cc
diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc
index e85c217ffbcd933c34dfd5f9f2944d5529dea4a3..ea4f8167fa28cc7098ce233cddbd7ed77fd23a77 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -154,23 +154,10 @@
ImportPersistentHistograms();
HistogramBase* histogram = StatisticsRecorder::FindHistogram(name_);
-
- // crbug.com/588946 debugging. See comment at end of function.
- const BucketRanges* created_ranges =
- reinterpret_cast<const BucketRanges*>(0xDEADBEEF);
- const BucketRanges* registered_ranges =
- reinterpret_cast<const BucketRanges*>(0xDEADBEEF);
- HistogramBase* tentative_histogram =
- reinterpret_cast<HistogramBase*>(0xDEADBEEF);
- PersistentMemoryAllocator* allocator =
- reinterpret_cast<PersistentMemoryAllocator*>(0xDEADBEEF);
- PersistentMemoryAllocator::Reference histogram_ref = 0xDEADBEEF;
- bool bad_args = false;
-
if (!histogram) {
// To avoid racy destruction at shutdown, the following will be leaked.
- created_ranges = CreateRanges();
- registered_ranges =
+ const BucketRanges* created_ranges = CreateRanges();
+ const BucketRanges* registered_ranges =
StatisticsRecorder::RegisterOrDeleteDuplicateRanges(created_ranges);
// In most cases, the bucket-count, minimum, and maximum values are known
@@ -189,9 +176,9 @@
// that is off by default. If the allocator doesn't exist or if
// allocating from it fails, code below will allocate the histogram from
// the process heap.
- histogram_ref = 0;
- tentative_histogram = nullptr;
- allocator =
+ PersistentMemoryAllocator::Reference histogram_ref = 0;
+ HistogramBase* tentative_histogram = nullptr;
+ PersistentMemoryAllocator* allocator =
GetPersistentHistogramMemoryAllocator();
if (allocator) {
flags_ |= HistogramBase::kIsPersistent;
@@ -236,38 +223,8 @@
// on dereference, but extension/Pepper APIs will guard against NULL and not
// crash.
DLOG(ERROR) << "Histogram " << name_ << " has bad construction arguments";
- bad_args = true;
- histogram = nullptr;
- }
-
-#if !DCHECK_IS_ON() // Don't affect tests, only release builds.
- // For the moment, crash here so that collected crash reports have access
- // to the construction values in order to figure out why this is failing.
- // TODO(bcwhite): Remove this once crbug.com/588946 is resolved. Also remove
- // from beta-branch because we don't want crashes due to misbehaving
- // extensions (see comment above).
- if (!histogram) {
- HistogramType histogram_type = histogram_type_;
- HistogramBase::Sample minimum = minimum_;
- HistogramBase::Sample maximum = maximum_;
- uint32_t bucket_count = bucket_count_;
- int32_t flags = flags_;
- CHECK(histogram) << name_ << ": bad-args=" << bad_args;
- base::debug::Alias(&histogram_type);
- base::debug::Alias(&minimum);
- base::debug::Alias(&maximum);
- base::debug::Alias(&bucket_count);
- base::debug::Alias(&flags);
- base::debug::Alias(&created_ranges);
- base::debug::Alias(&registered_ranges);
- base::debug::Alias(&histogram_ref);
- base::debug::Alias(&tentative_histogram);
- base::debug::Alias(&allocator);
- base::debug::Alias(&tentative_histogram);
- }
-#endif
-
- base::debug::Alias(&bad_args); // Down here so var is always "used".
+ return nullptr;
+ }
return histogram;
}
« no previous file with comments | « no previous file | base/metrics/histogram_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698