| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 NET_ANDROID_TRAFFIC_STATS_H_ | 5 #ifndef NET_ANDROID_TRAFFIC_STATS_H_ |
| 6 #define NET_ANDROID_TRAFFIC_STATS_H_ | 6 #define NET_ANDROID_TRAFFIC_STATS_H_ |
| 7 | 7 |
| 8 // This file provides functions that interact with TrafficStats APIs that are | 8 // This file provides functions that interact with TrafficStats APIs that are |
| 9 // provided on Android. | 9 // provided on Android. |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // and UDP usage. |bytes| must not be nullptr. | 40 // and UDP usage. |bytes| must not be nullptr. |
| 41 NET_EXPORT bool GetCurrentUidTxBytes(int64_t* bytes); | 41 NET_EXPORT bool GetCurrentUidTxBytes(int64_t* bytes); |
| 42 | 42 |
| 43 // Returns true if the number of bytes attributed to caller's UID since device | 43 // Returns true if the number of bytes attributed to caller's UID since device |
| 44 // boot are available and sets |*bytes| to that value. Counts packets across | 44 // boot are available and sets |*bytes| to that value. Counts packets across |
| 45 // all network interfaces, and always increases monotonically since device | 45 // all network interfaces, and always increases monotonically since device |
| 46 // boot. Statistics are measured at the network layer, so they include both TCP | 46 // boot. Statistics are measured at the network layer, so they include both TCP |
| 47 // and UDP usage. |bytes| must not be nullptr. | 47 // and UDP usage. |bytes| must not be nullptr. |
| 48 NET_EXPORT bool GetCurrentUidRxBytes(int64_t* bytes); | 48 NET_EXPORT bool GetCurrentUidRxBytes(int64_t* bytes); |
| 49 | 49 |
| 50 bool Register(JNIEnv* env); | |
| 51 | |
| 52 } // namespace traffic_stats | 50 } // namespace traffic_stats |
| 53 | 51 |
| 54 } // namespace android | 52 } // namespace android |
| 55 | 53 |
| 56 } // namespace net | 54 } // namespace net |
| 57 | 55 |
| 58 #endif // NET_ANDROID_TRAFFIC_STATS_H_ | 56 #endif // NET_ANDROID_TRAFFIC_STATS_H_ |
| OLD | NEW |