Chromium Code Reviews| 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() |
| 10 : traffic_type_(UNKNOWN), total_bytes_sent_(0), total_bytes_received_(0) {} | |
| 10 | 11 |
| 11 DataUse::DataUse(const DataUse& other) : | 12 DataUse::DataUse(const DataUse& other) : |
| 12 total_bytes_sent_(other.total_bytes_sent_), | 13 total_bytes_sent_(other.total_bytes_sent_), |
| 13 total_bytes_received_(other.total_bytes_received_) {} | 14 total_bytes_received_(other.total_bytes_received_) {} |
|
tbansal1
2017/05/09 00:59:08
Add |traffic_type_| here.
rajendrant
2017/05/11 21:16:08
Done.
| |
| 14 | 15 |
| 15 DataUse::~DataUse() {} | 16 DataUse::~DataUse() {} |
| 16 | 17 |
| 17 void DataUse::MergeFrom(const DataUse& other) { | 18 void DataUse::MergeFrom(const DataUse& other) { |
| 18 total_bytes_sent_ += other.total_bytes_sent_; | 19 total_bytes_sent_ += other.total_bytes_sent_; |
| 19 total_bytes_received_ += other.total_bytes_received_; | 20 total_bytes_received_ += other.total_bytes_received_; |
|
tbansal1
2017/05/09 00:59:08
May be DCHECK that |traffic_type_| matches |other.
rajendrant
2017/05/11 21:16:08
Need not be same while merging. When render frame
tbansal1
2017/05/12 15:59:58
May be add that as a comment here?
rajendrant
2017/05/16 00:50:08
Done.
| |
| 20 } | 21 } |
| 21 | 22 |
| 22 } // namespace data_use_measurement | 23 } // namespace data_use_measurement |
| OLD | NEW |