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

Unified Diff: third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp

Issue 2883763002: Expose ECT to render frames, Blink and NetInfo (Closed)
Patch Set: rebased Created 3 years, 7 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/platform/network/NetworkStateNotifier.cpp
diff --git a/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp b/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp
index afecd9adba79b29c81ebb51222369eb7da1fc68f..46d6824a532edc1fb752bf0acf1708e31ab9f588 100644
--- a/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp
+++ b/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp
@@ -59,6 +59,7 @@ NetworkStateNotifier::ScopedNotifier::~ScopedNotifier() {
notifier_.has_override_ ? notifier_.override_ : notifier_.state_;
if ((after.type != before_.type ||
after.max_bandwidth_mbps != before_.max_bandwidth_mbps ||
+ after.effective_type != before_.effective_type ||
after.http_rtt != before_.http_rtt ||
after.transport_rtt != before_.transport_rtt ||
after.downlink_throughput_mbps != before_.downlink_throughput_mbps) &&
@@ -94,7 +95,8 @@ void NetworkStateNotifier::SetWebConnection(WebConnectionType type,
}
}
-void NetworkStateNotifier::SetNetworkQuality(TimeDelta http_rtt,
+void NetworkStateNotifier::SetNetworkQuality(WebEffectiveConnectionType type,
+ TimeDelta http_rtt,
TimeDelta transport_rtt,
int downlink_throughput_kbps) {
DCHECK(IsMainThread());
@@ -102,6 +104,7 @@ void NetworkStateNotifier::SetNetworkQuality(TimeDelta http_rtt,
{
MutexLocker locker(mutex_);
+ state_.effective_type = type;
state_.http_rtt = base::nullopt;
state_.transport_rtt = base::nullopt;
state_.downlink_throughput_mbps = base::nullopt;
@@ -209,8 +212,9 @@ void NetworkStateNotifier::NotifyObserversOnTaskRunner(
continue;
case ObserverType::CONNECTION_TYPE:
observer_list->observers[i]->ConnectionChange(
- state.type, state.max_bandwidth_mbps, state.http_rtt,
- state.transport_rtt, state.downlink_throughput_mbps);
+ state.type, state.max_bandwidth_mbps, state.effective_type,
+ state.http_rtt, state.transport_rtt,
+ state.downlink_throughput_mbps);
continue;
}
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698