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

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

Issue 2863973003: Expose RTT and downlink bandwidth using experimental Javascript API (Closed)
Patch Set: jkarlin comments 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/modules/netinfo/NetworkInformation.h
diff --git a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h
index 5ac714c2bed778ec5f2fd7dbd085b0ccbca6ff6f..0ab041fd3fc415efa72d71000ff5f7edf77dec3e 100644
--- a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h
+++ b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h
@@ -29,9 +29,15 @@ class NetworkInformation final
String type() const;
double downlinkMax() const;
+ long rtt() const;
+ double downlink() const;
// NetworkStateObserver overrides.
- void ConnectionChange(WebConnectionType, double downlink_max_mbps) override;
+ void ConnectionChange(WebConnectionType,
+ double downlink_max_mbps,
+ int http_rtt_msec,
+ int transport_rtt_msec,
+ double downlink_mbps) override;
// EventTarget overrides.
const AtomicString& InterfaceName() const override;
@@ -67,6 +73,14 @@ class NetworkInformation final
// Touched only on context thread.
double downlink_max_mbps_;
+ // Transport RTT estimate. Rounded off to the nearest 25 msec. Touched only on
+ // context thread.
+ int transport_rtt_msec_;
+
+ // Downlink throughput estimate. Rounded off to the nearest 25 kbps. Touched
+ // only on context thread.
+ double downlink_mbps_;
+
// Whether this object is listening for events from NetworkStateNotifier.
bool observing_;

Powered by Google App Engine
This is Rietveld 408576698