Chromium Code Reviews| Index: content/common/child_histogram_message_filter.cc |
| diff --git a/content/common/child_histogram_message_filter.cc b/content/common/child_histogram_message_filter.cc |
| index 8aae265307f6de35127c5311008c84c6a534f9f3..750574b17bd2c0e82dcab561c98617c24a6f9492 100644 |
| --- a/content/common/child_histogram_message_filter.cc |
| +++ b/content/common/child_histogram_message_filter.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/bind.h" |
| #include "base/message_loop.h" |
| #include "base/metrics/statistics_recorder.h" |
| +#include "base/pickle.h" |
| #include "content/common/child_process.h" |
| #include "content/common/child_process_messages.h" |
| #include "content/common/child_thread.h" |
| @@ -57,6 +58,9 @@ void ChildHistogramMessageFilter::UploadAllHistograms(int sequence_number) { |
| base::StatisticsRecorder::CollectHistogramStats("ChildProcess"); |
| // Push snapshots into our pickled_histograms_ vector. |
| + // Note. Before serializing, we set the kIPCSerializationSourceFlag to all |
| + // histograms. So the receiving process can distinguish them with the local |
| + // histograms. |
|
Ilya Sherman
2012/12/29 00:17:30
nit: "Note." -> "Note:"; "to all" -> "for all the"
kaiwang
2013/01/08 00:51:40
Done.
|
| histogram_snapshot_manager_.PrepareDeltas( |
| base::Histogram::kIPCSerializationSourceFlag, false); |
| @@ -73,10 +77,13 @@ void ChildHistogramMessageFilter::RecordDelta( |
| const base::Histogram& histogram, |
| const base::HistogramSamples& snapshot) { |
| DCHECK_NE(0, snapshot.TotalCount()); |
| - std::string histogram_info = |
| - base::Histogram::SerializeHistogramInfo(histogram, snapshot); |
| - pickled_histograms_.push_back(histogram_info); |
| + Pickle pickle; |
| + histogram.SerializeInfo(&pickle); |
| + snapshot.Serialize(&pickle); |
| + |
| + pickled_histograms_.push_back( |
| + std::string(static_cast<const char*>(pickle.data()), pickle.size())); |
| } |
| void ChildHistogramMessageFilter::InconsistencyDetected( |