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

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

Issue 23450016: Re-land https://codereview.chromium.org/23602005: Use nobarrier atomics for lossy counters in base:… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/metrics/histogram_base.h ('k') | base/metrics/sample_vector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/histogram_samples.h" 5 #include "base/metrics/histogram_samples.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/pickle.h" 8 #include "base/pickle.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 return false; 106 return false;
107 } 107 }
108 return true; 108 return true;
109 } 109 }
110 110
111 void HistogramSamples::IncreaseSum(int64 diff) { 111 void HistogramSamples::IncreaseSum(int64 diff) {
112 sum_ += diff; 112 sum_ += diff;
113 } 113 }
114 114
115 void HistogramSamples::IncreaseRedundantCount(HistogramBase::Count diff) { 115 void HistogramSamples::IncreaseRedundantCount(HistogramBase::Count diff) {
116 redundant_count_ += diff; 116 base::subtle::NoBarrier_Store(&redundant_count_,
117 base::subtle::NoBarrier_Load(&redundant_count_) + diff);
117 } 118 }
118 119
119 SampleCountIterator::~SampleCountIterator() {} 120 SampleCountIterator::~SampleCountIterator() {}
120 121
121 bool SampleCountIterator::GetBucketIndex(size_t* index) const { 122 bool SampleCountIterator::GetBucketIndex(size_t* index) const {
122 DCHECK(!Done()); 123 DCHECK(!Done());
123 return false; 124 return false;
124 } 125 }
125 126
126 } // namespace base 127 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/histogram_base.h ('k') | base/metrics/sample_vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698