Chromium Code Reviews| Index: components/data_use_measurement/core/data_use.h |
| diff --git a/components/data_use_measurement/core/data_use.h b/components/data_use_measurement/core/data_use.h |
| index 18e706dc6d4d40b45e151073bcb3d8df5c560f66..d84c469fa9748533ee46c221a459a0e457c31572 100644 |
| --- a/components/data_use_measurement/core/data_use.h |
| +++ b/components/data_use_measurement/core/data_use.h |
| @@ -18,6 +18,20 @@ namespace data_use_measurement { |
| // Class to store total network data used by some entity. |
| class DataUse { |
| public: |
| + enum TrafficType { |
| + // Unknown. |
| + UNKNOWN, |
| + |
| + // User initiated traffic. |
| + USER_TRAFFIC, |
| + |
| + // Chrome services. |
| + SERVICES, |
| + |
| + // Fetch from ServiceWorker. |
| + SERVICE_WORKER, |
| + }; |
| + |
| DataUse(); |
| DataUse(const DataUse& other); |
| ~DataUse(); |
| @@ -39,11 +53,18 @@ class DataUse { |
| int64_t total_bytes_sent() const { return total_bytes_sent_; } |
| + TrafficType traffic_type() { return traffic_type_; } |
| + |
| + void set_traffic_type(TrafficType traffic_type) { |
| + traffic_type_ = traffic_type; |
| + } |
| + |
| private: |
| friend class DataUseRecorder; |
| GURL url_; |
| std::string description_; |
| + TrafficType traffic_type_; |
|
tbansal1
2017/05/09 00:59:08
Is it possible to make this a const field and make
rajendrant
2017/05/11 21:16:08
Made it as const field.
But still UNKNOWN type is
|
| int64_t total_bytes_sent_; |
| int64_t total_bytes_received_; |