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

Unified Diff: third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp

Issue 2941713002: NetInfo: Return HTTP layer metrics instead of transport layer (Closed)
Patch Set: ps 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
Index: third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp
diff --git a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp
index 16a688c7d27b02b3c763a9ccb8ce257a74beaabe..82986ecbc0196e6a6ff2b532b8eb3c2724f2e81f 100644
--- a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp
+++ b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp
@@ -131,9 +131,9 @@ String NetworkInformation::effectiveType() const {
unsigned long NetworkInformation::rtt() const {
if (!observing_)
- return RoundRtt(GetNetworkStateNotifier().TransportRtt());
+ return RoundRtt(GetNetworkStateNotifier().HttpRtt());
- return transport_rtt_msec_;
+ return http_rtt_msec_;
}
double NetworkInformation::downlink() const {
@@ -152,16 +152,15 @@ void NetworkInformation::ConnectionChange(
const Optional<double>& downlink_mbps) {
DCHECK(GetExecutionContext()->IsContextThread());
- unsigned long new_transport_rtt_msec = RoundRtt(transport_rtt);
+ unsigned long new_http_rtt_msec = RoundRtt(http_rtt);
double new_downlink_mbps = RoundMbps(downlink_mbps);
- // TODO(tbansal): https://crbug.com/719108. Dispatch |change| event if the
- // expected network quality has changed.
// This can happen if the observer removes and then adds itself again
- // during notification, or if |http_rtt| was the only metric that changed.
+ // during notification, or if |transport_rtt| was the only metric that
+ // changed.
if (type_ == type && downlink_max_mbps_ == downlink_max_mbps &&
effective_type_ == effective_type &&
- transport_rtt_msec_ == new_transport_rtt_msec &&
+ http_rtt_msec_ == new_http_rtt_msec &&
downlink_mbps_ == new_downlink_mbps) {
return;
}
@@ -169,7 +168,7 @@ void NetworkInformation::ConnectionChange(
type_ = type;
downlink_max_mbps_ = downlink_max_mbps;
effective_type_ = effective_type;
- transport_rtt_msec_ = new_transport_rtt_msec;
+ http_rtt_msec_ = new_http_rtt_msec;
downlink_mbps_ = new_downlink_mbps;
DispatchEvent(Event::Create(EventTypeNames::typechange));
@@ -244,7 +243,7 @@ NetworkInformation::NetworkInformation(ExecutionContext* context)
type_(GetNetworkStateNotifier().ConnectionType()),
downlink_max_mbps_(GetNetworkStateNotifier().MaxBandwidth()),
effective_type_(GetNetworkStateNotifier().EffectiveType()),
- transport_rtt_msec_(RoundRtt(GetNetworkStateNotifier().TransportRtt())),
+ http_rtt_msec_(RoundRtt(GetNetworkStateNotifier().HttpRtt())),
downlink_mbps_(
RoundMbps(GetNetworkStateNotifier().DownlinkThroughputMbps())),
observing_(false),

Powered by Google App Engine
This is Rietveld 408576698