| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/data_use_measurement/core/data_use.h" | 5 #include "components/data_use_measurement/core/data_use.h" |
| 6 | 6 |
| 7 namespace data_use_measurement { | 7 namespace data_use_measurement { |
| 8 | 8 |
| 9 DataUse::DataUse() : total_bytes_sent_(0), total_bytes_received_(0) {} | 9 DataUse::DataUse(TrafficType traffic_type) |
| 10 : traffic_type_(traffic_type), |
| 11 total_bytes_sent_(0), |
| 12 total_bytes_received_(0) {} |
| 10 | 13 |
| 11 DataUse::DataUse(const DataUse& other) : | 14 DataUse::DataUse(const DataUse& other) |
| 12 total_bytes_sent_(other.total_bytes_sent_), | 15 : traffic_type_(other.traffic_type_), |
| 13 total_bytes_received_(other.total_bytes_received_) {} | 16 total_bytes_sent_(other.total_bytes_sent_), |
| 17 total_bytes_received_(other.total_bytes_received_) {} |
| 14 | 18 |
| 15 DataUse::~DataUse() {} | 19 DataUse::~DataUse() {} |
| 16 | 20 |
| 17 void DataUse::MergeFrom(const DataUse& other) { | 21 void DataUse::MergeFrom(const DataUse& other) { |
| 18 total_bytes_sent_ += other.total_bytes_sent_; | 22 total_bytes_sent_ += other.total_bytes_sent_; |
| 19 total_bytes_received_ += other.total_bytes_received_; | 23 total_bytes_received_ += other.total_bytes_received_; |
| 20 } | 24 } |
| 21 | 25 |
| 22 } // namespace data_use_measurement | 26 } // namespace data_use_measurement |
| OLD | NEW |