Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: net/nqe/network_quality_observation.h

Issue 2763853002: Use Android callback API to obtain cellular signal strength (Closed)
Patch Set: comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/nqe/network_quality_estimator_params.cc ('k') | net/nqe/observation_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_observation.h
diff --git a/net/nqe/network_quality_observation.h b/net/nqe/network_quality_observation.h
index 91d163303ba4802c00c1b66cbda4a422aee3d383..f6b1cb88e06ccd15bab2eea35aff221c30d37991 100644
--- a/net/nqe/network_quality_observation.h
+++ b/net/nqe/network_quality_observation.h
@@ -5,10 +5,13 @@
#ifndef NET_NQE_NETWORK_QUALITY_OBSERVATION_H_
#define NET_NQE_NETWORK_QUALITY_OBSERVATION_H_
+#include <stdint.h>
+
#include <vector>
#include "base/gtest_prod_util.h"
#include "base/macros.h"
+#include "base/optional.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
#include "net/nqe/network_quality_observation_source.h"
@@ -28,11 +31,11 @@ template <typename ValueType>
struct NET_EXPORT_PRIVATE Observation {
Observation(const ValueType& value,
base::TimeTicks timestamp,
- int32_t signal_strength_dbm,
+ const base::Optional<int32_t>& signal_strength,
NetworkQualityObservationSource source)
: value(value),
timestamp(timestamp),
- signal_strength_dbm(signal_strength_dbm),
+ signal_strength(signal_strength),
source(source) {
DCHECK(!timestamp.is_null());
}
@@ -44,9 +47,8 @@ struct NET_EXPORT_PRIVATE Observation {
// Time when the observation was taken.
const base::TimeTicks timestamp;
- // Signal strength (in dBm) when the observation was taken. Set to INT32_MIN
- // if the signal strength is unavailable.
- const int32_t signal_strength_dbm;
+ // Signal strength when the observation was taken.
+ const base::Optional<int32_t> signal_strength;
// The source of the observation.
const NetworkQualityObservationSource source;
« no previous file with comments | « net/nqe/network_quality_estimator_params.cc ('k') | net/nqe/observation_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698