| 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 #ifndef COMPONENTS_DATA_USE_MEASUREMENT_CORE_DATA_USE_H_ | 5 #ifndef COMPONENTS_DATA_USE_MEASUREMENT_CORE_DATA_USE_H_ |
| 6 #define COMPONENTS_DATA_USE_MEASUREMENT_CORE_DATA_USE_H_ | 6 #define COMPONENTS_DATA_USE_MEASUREMENT_CORE_DATA_USE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // Chrome services. | 33 // Chrome services. |
| 34 SERVICES, | 34 SERVICES, |
| 35 | 35 |
| 36 // Fetch from ServiceWorker. | 36 // Fetch from ServiceWorker. |
| 37 SERVICE_WORKER, | 37 SERVICE_WORKER, |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 explicit DataUse(TrafficType traffic_type); | 40 explicit DataUse(TrafficType traffic_type); |
| 41 ~DataUse() override; | 41 ~DataUse() override; |
| 42 | 42 |
| 43 // Merge data use from another instance. | |
| 44 // TODO(rajendrant): Check if the merge can be removed. Otherwise user data | |
| 45 // needs to support mergeability. | |
| 46 void MergeFrom(const DataUse& other); | |
| 47 | |
| 48 // Returns the page URL. | 43 // Returns the page URL. |
| 49 const GURL& url() const { return url_; } | 44 const GURL& url() const { return url_; } |
| 50 | 45 |
| 51 void set_url(const GURL& url) { url_ = url; } | 46 void set_url(const GURL& url) { url_ = url; } |
| 52 | 47 |
| 53 const std::string& description() const { return description_; } | 48 const std::string& description() const { return description_; } |
| 54 | 49 |
| 55 void set_description(const std::string& description) { | 50 void set_description(const std::string& description) { |
| 56 description_ = description; | 51 description_ = description; |
| 57 } | 52 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 73 | 68 |
| 74 int64_t total_bytes_sent_; | 69 int64_t total_bytes_sent_; |
| 75 int64_t total_bytes_received_; | 70 int64_t total_bytes_received_; |
| 76 | 71 |
| 77 DISALLOW_COPY_AND_ASSIGN(DataUse); | 72 DISALLOW_COPY_AND_ASSIGN(DataUse); |
| 78 }; | 73 }; |
| 79 | 74 |
| 80 } // namespace data_use_measurement | 75 } // namespace data_use_measurement |
| 81 | 76 |
| 82 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CORE_DATA_USE_H_ | 77 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CORE_DATA_USE_H_ |
| OLD | NEW |