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

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

Issue 2863973003: Expose RTT and downlink bandwidth using experimental Javascript API (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/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..01626ab1e02c6b7b0c599dce8ad2346e2223ae08 100644
--- a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h
+++ b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h
@@ -9,6 +9,8 @@
#include "core/events/EventTarget.h"
#include "platform/bindings/ActiveScriptWrappable.h"
#include "platform/network/NetworkStateNotifier.h"
+#include "platform/wtf/Optional.h"
+#include "platform/wtf/Time.h"
#include "public/platform/WebConnectionType.h"
namespace blink {
@@ -29,9 +31,15 @@ class NetworkInformation final
String type() const;
double downlinkMax() const;
+ unsigned long rtt() const;
+ double downlink() const;
// NetworkStateObserver overrides.
- void ConnectionChange(WebConnectionType, double downlink_max_mbps) override;
+ void ConnectionChange(WebConnectionType,
+ double downlink_max_mbps,
+ const Optional<TimeDelta>& http_rtt,
+ const Optional<TimeDelta>& transport_rtt,
+ const Optional<double>& downlink_mbps) override;
// EventTarget overrides.
const AtomicString& InterfaceName() const override;
@@ -67,6 +75,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.
+ unsigned long 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_;
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698