| gayane | 8ff87807 | 2016-05-19 18:04:20 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef COMPONENTS_METRICS_NET_CELLULAR_LOGIC_HELPER_H_ |
| 6 | #define COMPONENTS_METRICS_NET_CELLULAR_LOGIC_HELPER_H_ |
| 7 | |
| 8 | #include "base/time/time.h" |
| 9 | |
| 10 | namespace metrics { |
| 11 | |
| Nate Fischer | 1a2d36f | 2019-10-08 05:19:21 | [diff] [blame] | 12 | // Returns UMA log upload interval based on OS. If |
| 13 | // |use_cellular_upload_interval| is true, this returns an interval suitable for |
| 14 | // metered cellular connections. Otherwise, this returns an interval suitable |
| 15 | // for unmetered (ex. WiFi) connections. |
| 16 | base::TimeDelta GetUploadInterval(bool use_cellular_upload_interval); |
| gayane | 8ff87807 | 2016-05-19 18:04:20 | [diff] [blame] | 17 | |
| Nate Fischer | 1a2d36f | 2019-10-08 05:19:21 | [diff] [blame] | 18 | // Returns true if current connection type is cellular and the platform supports |
| 19 | // using a separate interval for cellular connections (at the moment, this is |
| 20 | // supported for OS_ANDROID and OS_IOS). |
| 21 | bool ShouldUseCellularUploadInterval(); |
| gayane | 8ff87807 | 2016-05-19 18:04:20 | [diff] [blame] | 22 | |
| 23 | } // namespace metrics |
| 24 | |
| 25 | #endif // COMPONENTS_METRICS_NET_CELLULAR_LOGIC_HELPER_H_ |