Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / net / android / traffic_stats.h
blob3434d89d509212c4aa7472af3f0335c5f7ef2df4
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
3 // found in the LICENSE file.
5 #ifndef NET_ANDROID_TRAFFIC_STATS_H_
6 #define NET_ANDROID_TRAFFIC_STATS_H_
8 // This file provides functions that interact with TrafficStats APIs that are
9 // provided on Android.
11 #include <jni.h>
12 #include <stdint.h>
14 #include "net/base/net_export.h"
16 namespace net {
18 namespace android {
20 namespace traffic_stats {
22 // Returns true if the number of bytes transmitted since device boot is
23 // available and sets |*bytes| to that value. Counts packets across all network
24 // interfaces, and always increases monotonically since device boot.
25 // Statistics are measured at the network layer, so they include both TCP and
26 // UDP usage. |bytes| must not be nullptr.
27 NET_EXPORT bool GetTotalTxBytes(int64_t* bytes);
29 bool Register(JNIEnv* env);
31 } // namespace traffic_stats
33 } // namespace android
35 } // namespace net
37 #endif // NET_ANDROID_TRAFFIC_STATS_H_