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

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

Issue 596103002: Fix more disabled MSVC warnings, base/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment Created 6 years, 2 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.cc ('k') | base/numerics/safe_math.h » ('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_base.h" 5 #include "base/metrics/histogram_base.h"
6 6
7 #include <climits> 7 #include <climits>
8 8
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 int64 sum; 102 int64 sum;
103 scoped_ptr<ListValue> buckets(new ListValue()); 103 scoped_ptr<ListValue> buckets(new ListValue());
104 GetCountAndBucketData(&count, &sum, buckets.get()); 104 GetCountAndBucketData(&count, &sum, buckets.get());
105 scoped_ptr<DictionaryValue> parameters(new DictionaryValue()); 105 scoped_ptr<DictionaryValue> parameters(new DictionaryValue());
106 GetParameters(parameters.get()); 106 GetParameters(parameters.get());
107 107
108 JSONStringValueSerializer serializer(output); 108 JSONStringValueSerializer serializer(output);
109 DictionaryValue root; 109 DictionaryValue root;
110 root.SetString("name", histogram_name()); 110 root.SetString("name", histogram_name());
111 root.SetInteger("count", count); 111 root.SetInteger("count", count);
112 root.SetDouble("sum", sum); 112 root.SetDouble("sum", static_cast<double>(sum));
113 root.SetInteger("flags", flags()); 113 root.SetInteger("flags", flags());
114 root.Set("params", parameters.release()); 114 root.Set("params", parameters.release());
115 root.Set("buckets", buckets.release()); 115 root.Set("buckets", buckets.release());
116 root.SetInteger("pid", GetCurrentProcId()); 116 root.SetInteger("pid", GetCurrentProcId());
117 serializer.Serialize(root); 117 serializer.Serialize(root);
118 } 118 }
119 119
120 void HistogramBase::WriteAsciiBucketGraph(double current_size, 120 void HistogramBase::WriteAsciiBucketGraph(double current_size,
121 double max_size, 121 double max_size,
122 std::string* output) const { 122 std::string* output) const {
(...skipping 19 matching lines...) Expand all
142 return result; 142 return result;
143 } 143 }
144 144
145 void HistogramBase::WriteAsciiBucketValue(Count current, 145 void HistogramBase::WriteAsciiBucketValue(Count current,
146 double scaled_sum, 146 double scaled_sum,
147 std::string* output) const { 147 std::string* output) const {
148 StringAppendF(output, " (%d = %3.1f%%)", current, current/scaled_sum); 148 StringAppendF(output, " (%d = %3.1f%%)", current, current/scaled_sum);
149 } 149 }
150 150
151 } // namespace base 151 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/numerics/safe_math.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698