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

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

Issue 1913803003: Write non-critical log messages only for -v=1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « base/metrics/histogram_base.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "base/metrics/persistent_histogram_allocator.h" 5 #include "base/metrics/persistent_histogram_allocator.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 // static 653 // static
654 void GlobalHistogramAllocator::Set( 654 void GlobalHistogramAllocator::Set(
655 std::unique_ptr<GlobalHistogramAllocator> allocator) { 655 std::unique_ptr<GlobalHistogramAllocator> allocator) {
656 // Releasing or changing an allocator is extremely dangerous because it 656 // Releasing or changing an allocator is extremely dangerous because it
657 // likely has histograms stored within it. If the backing memory is also 657 // likely has histograms stored within it. If the backing memory is also
658 // also released, future accesses to those histograms will seg-fault. 658 // also released, future accesses to those histograms will seg-fault.
659 CHECK(!g_allocator); 659 CHECK(!g_allocator);
660 g_allocator = allocator.release(); 660 g_allocator = allocator.release();
661 size_t existing = StatisticsRecorder::GetHistogramCount(); 661 size_t existing = StatisticsRecorder::GetHistogramCount();
662 662
663 DLOG_IF(WARNING, existing) 663 DVLOG_IF(1, existing)
664 << existing << " histograms were created before persistence was enabled."; 664 << existing << " histograms were created before persistence was enabled.";
665 } 665 }
666 666
667 // static 667 // static
668 GlobalHistogramAllocator* GlobalHistogramAllocator::Get() { 668 GlobalHistogramAllocator* GlobalHistogramAllocator::Get() {
669 return g_allocator; 669 return g_allocator;
670 } 670 }
671 671
672 // static 672 // static
673 std::unique_ptr<GlobalHistogramAllocator> 673 std::unique_ptr<GlobalHistogramAllocator>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 while (true) { 724 while (true) {
725 std::unique_ptr<HistogramBase> histogram = 725 std::unique_ptr<HistogramBase> histogram =
726 import_iterator_.GetNextWithIgnore(record_to_ignore); 726 import_iterator_.GetNextWithIgnore(record_to_ignore);
727 if (!histogram) 727 if (!histogram)
728 break; 728 break;
729 StatisticsRecorder::RegisterOrDeleteDuplicate(histogram.release()); 729 StatisticsRecorder::RegisterOrDeleteDuplicate(histogram.release());
730 } 730 }
731 } 731 }
732 732
733 } // namespace base 733 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/histogram_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698