| 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 20 matching lines...) Expand all Loading... |
| 31 const std::string& description() const { return description_; } | 31 const std::string& description() const { return description_; } |
| 32 | 32 |
| 33 void set_description(const std::string& description) { | 33 void set_description(const std::string& description) { |
| 34 description_ = description; | 34 description_ = description; |
| 35 } | 35 } |
| 36 | 36 |
| 37 int64_t total_bytes_received() const { return total_bytes_received_; } | 37 int64_t total_bytes_received() const { return total_bytes_received_; } |
| 38 | 38 |
| 39 int64_t total_bytes_sent() const { return total_bytes_sent_; } | 39 int64_t total_bytes_sent() const { return total_bytes_sent_; } |
| 40 | 40 |
| 41 base::Time start_time() const { return start_time_; } |
| 42 |
| 41 private: | 43 private: |
| 42 friend class DataUseRecorder; | 44 friend class DataUseRecorder; |
| 43 | 45 |
| 44 GURL url_; | 46 GURL url_; |
| 45 std::string description_; | 47 std::string description_; |
| 46 | 48 |
| 47 int64_t total_bytes_sent_; | 49 int64_t total_bytes_sent_; |
| 48 int64_t total_bytes_received_; | 50 int64_t total_bytes_received_; |
| 49 | 51 |
| 52 // When this data use started. |
| 53 base::Time start_time_; |
| 54 |
| 50 DISALLOW_COPY_AND_ASSIGN(DataUse); | 55 DISALLOW_COPY_AND_ASSIGN(DataUse); |
| 51 }; | 56 }; |
| 52 | 57 |
| 53 } // namespace data_use_measurement | 58 } // namespace data_use_measurement |
| 54 | 59 |
| 55 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CORE_DATA_USE_H_ | 60 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CORE_DATA_USE_H_ |
| OLD | NEW |