| Index: components/data_use_measurement/core/data_use.cc
|
| diff --git a/components/data_use_measurement/core/data_use.cc b/components/data_use_measurement/core/data_use.cc
|
| index c84da07f1faf1bd8eab55c7529b754583533330f..99fb8cb2f953705154b93b2bf132c5c502ee8baa 100644
|
| --- a/components/data_use_measurement/core/data_use.cc
|
| +++ b/components/data_use_measurement/core/data_use.cc
|
| @@ -6,15 +6,18 @@
|
|
|
| namespace data_use_measurement {
|
|
|
| -DataUse::DataUse() : total_bytes_sent_(0), total_bytes_received_(0) {}
|
| -
|
| -DataUse::DataUse(const DataUse& other) :
|
| - total_bytes_sent_(other.total_bytes_sent_),
|
| - total_bytes_received_(other.total_bytes_received_) {}
|
| +DataUse::DataUse(TrafficType traffic_type)
|
| + : traffic_type_(traffic_type),
|
| + total_bytes_sent_(0),
|
| + total_bytes_received_(0) {}
|
|
|
| DataUse::~DataUse() {}
|
|
|
| void DataUse::MergeFrom(const DataUse& other) {
|
| + // Traffic type need not be same while merging. One of the data use created
|
| + // when mainframe is created could have UNKNOWN traffic type, and later merged
|
| + // with the data use created for its mainframe request which could be
|
| + // USER_TRAFFIC.
|
| total_bytes_sent_ += other.total_bytes_sent_;
|
| total_bytes_received_ += other.total_bytes_received_;
|
| }
|
|
|