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

Unified Diff: base/metrics/sparse_histogram.cc

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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 | « base/metrics/sparse_histogram.h ('k') | base/metrics/sparse_histogram_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/sparse_histogram.cc
diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc
index 773eeb6273c5f8feef7eb77b545cf978d882a223..e5cdb43c04fea1514a032ca3e5c311899a979af4 100644
--- a/base/metrics/sparse_histogram.cc
+++ b/base/metrics/sparse_histogram.cc
@@ -10,16 +10,14 @@
#include "base/strings/stringprintf.h"
#include "base/synchronization/lock.h"
-using std::map;
-using std::string;
-
namespace base {
typedef HistogramBase::Count Count;
typedef HistogramBase::Sample Sample;
// static
-HistogramBase* SparseHistogram::FactoryGet(const string& name, int32 flags) {
+HistogramBase* SparseHistogram::FactoryGet(const std::string& name,
+ int32 flags) {
HistogramBase* histogram = StatisticsRecorder::FindHistogram(name);
if (!histogram) {
@@ -70,13 +68,13 @@ bool SparseHistogram::AddSamplesFromPickle(PickleIterator* iter) {
return samples_.AddFromPickle(iter);
}
-void SparseHistogram::WriteHTMLGraph(string* output) const {
+void SparseHistogram::WriteHTMLGraph(std::string* output) const {
output->append("<PRE>");
WriteAsciiImpl(true, "<br>", output);
output->append("</PRE>");
}
-void SparseHistogram::WriteAscii(string* output) const {
+void SparseHistogram::WriteAscii(std::string* output) const {
WriteAsciiImpl(true, "\n", output);
}
@@ -84,11 +82,11 @@ bool SparseHistogram::SerializeInfoImpl(Pickle* pickle) const {
return pickle->WriteString(histogram_name()) && pickle->WriteInt(flags());
}
-SparseHistogram::SparseHistogram(const string& name)
+SparseHistogram::SparseHistogram(const std::string& name)
: HistogramBase(name) {}
HistogramBase* SparseHistogram::DeserializeInfoImpl(PickleIterator* iter) {
- string histogram_name;
+ std::string histogram_name;
int flags;
if (!iter->ReadString(&histogram_name) || !iter->ReadInt(&flags)) {
DLOG(ERROR) << "Pickle error decoding Histogram: " << histogram_name;
@@ -129,8 +127,7 @@ void SparseHistogram::WriteAsciiImpl(bool graph_it,
Count largest_count = 0;
Sample largest_sample = 0;
scoped_ptr<SampleCountIterator> it = snapshot->Iterator();
- while (!it->Done())
- {
+ while (!it->Done()) {
Sample min;
Sample max;
Count count;
@@ -145,15 +142,14 @@ void SparseHistogram::WriteAsciiImpl(bool graph_it,
// iterate over each item and display them
it = snapshot->Iterator();
- while (!it->Done())
- {
+ while (!it->Done()) {
Sample min;
Sample max;
Count count;
it->Get(&min, &max, &count);
// value is min, so display it
- string range = GetSimpleAsciiBucketRange(min);
+ std::string range = GetSimpleAsciiBucketRange(min);
output->append(range);
for (size_t j = 0; range.size() + j < print_width + 1; ++j)
output->push_back(' ');
« no previous file with comments | « base/metrics/sparse_histogram.h ('k') | base/metrics/sparse_histogram_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698