diff options
author | gspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-21 23:33:17 +0000 |
---|---|---|
committer | gspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-21 23:33:17 +0000 |
commit | 1b2bfdd574d9c4e21251ec2214e41d8905da4541 (patch) | |
tree | 125a1781c38b840effa24926a16f9599c0631281 /o3d/statsreport | |
parent | c7cc3f559ecc96849168432c7d3abcca4eeebb4f (diff) | |
download | chromium_src-1b2bfdd574d9c4e21251ec2214e41d8905da4541.zip chromium_src-1b2bfdd574d9c4e21251ec2214e41d8905da4541.tar.gz chromium_src-1b2bfdd574d9c4e21251ec2214e41d8905da4541.tar.bz2 |
This fixes a number of things that are warnings in the Mac compiler.
It fixes at least two real bugs, one in the tar generator, and one
in stream_bank.h.
Review URL: http://codereview.chromium.org/159168
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/statsreport')
-rw-r--r-- | o3d/statsreport/formatter.h | 6 | ||||
-rw-r--r-- | o3d/statsreport/formatter_unittest.cc | 2 | ||||
-rw-r--r-- | o3d/statsreport/uploader_aggregation-mac.mm | 2 | ||||
-rw-r--r-- | o3d/statsreport/uploader_aggregation-posix.cc | 3 | ||||
-rw-r--r-- | o3d/statsreport/uploader_aggregation-win32.cc | 2 |
5 files changed, 8 insertions, 7 deletions
diff --git a/o3d/statsreport/formatter.h b/o3d/statsreport/formatter.h index eab534d..38316a6 100644 --- a/o3d/statsreport/formatter.h +++ b/o3d/statsreport/formatter.h @@ -35,7 +35,7 @@ #ifndef O3D_STATSREPORT_FORMATTER_H__ #define O3D_STATSREPORT_FORMATTER_H__ -#include <strstream> +#include <sstream> #include "base/basictypes.h" #include "metrics.h" @@ -63,13 +63,13 @@ class Formatter { // Terminates the output string and returns it. // It is an error to add metrics after output() is called. - const char *output() { + const std::string output() { output_ << std::ends; return output_.str(); } private: - mutable std::strstream output_; + mutable std::ostringstream output_; DISALLOW_COPY_AND_ASSIGN(Formatter); }; diff --git a/o3d/statsreport/formatter_unittest.cc b/o3d/statsreport/formatter_unittest.cc index 6567efd..f1315ea0 100644 --- a/o3d/statsreport/formatter_unittest.cc +++ b/o3d/statsreport/formatter_unittest.cc @@ -50,5 +50,5 @@ TEST(Formatter, Format) { "&integer1:i=3000" "&boolean1:b=t" "&boolean2:b=f", - formatter.output()); + formatter.output().c_str()); } diff --git a/o3d/statsreport/uploader_aggregation-mac.mm b/o3d/statsreport/uploader_aggregation-mac.mm index ff7d86ef..5037f32 100644 --- a/o3d/statsreport/uploader_aggregation-mac.mm +++ b/o3d/statsreport/uploader_aggregation-mac.mm @@ -112,7 +112,7 @@ static bool ReportMetrics(const char* extra_url_data, DLOG(INFO) << "formatter.output() = " << formatter.output(); return stats_uploader->UploadMetrics(extra_url_data, user_agent, - formatter.output()); + formatter.output().c_str()); } void ResetPersistentMetrics() { diff --git a/o3d/statsreport/uploader_aggregation-posix.cc b/o3d/statsreport/uploader_aggregation-posix.cc index dca530b..91f807b 100644 --- a/o3d/statsreport/uploader_aggregation-posix.cc +++ b/o3d/statsreport/uploader_aggregation-posix.cc @@ -67,7 +67,8 @@ bool ReportMetrics(MetricsAggregatorPosix *aggregator, Formatter formatter(PRODUCT_NAME_STRING, interval); aggregator->FormatMetrics(&formatter); - return UploadMetrics(extra_url_data, user_agent, formatter.output()); + DLOG(INFO) << "formatter.output() = " << formatter.output(); + return UploadMetrics(extra_url_data, user_agent, formatter.output().c_str()); } } // namespace diff --git a/o3d/statsreport/uploader_aggregation-win32.cc b/o3d/statsreport/uploader_aggregation-win32.cc index a22dcf3..d2f438e 100644 --- a/o3d/statsreport/uploader_aggregation-win32.cc +++ b/o3d/statsreport/uploader_aggregation-win32.cc @@ -71,7 +71,7 @@ static bool ReportMetrics(const char* extra_url_data, formatter.AddMetric(*it); DLOG(INFO) << "formatter.output() = " << formatter.output(); return stats_uploader->UploadMetrics(extra_url_data, user_agent, - formatter.output()); + formatter.output().c_str()); } void ResetPersistentMetrics(CRegKey *key) { |