Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3952)

Unified Diff: components/data_use_measurement/core/data_use.cc

Issue 2865913002: Support for identifying traffic type in data use ascriber (Closed)
Patch Set: compile fix Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;
}
« no previous file with comments | « components/data_use_measurement/core/data_use.h ('k') | components/data_use_measurement/core/data_use_measurement_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698